If I directly set the graphic object of the TPicture from a PNG for example and then free the PNG the TPicture no longer has a Valid image, which indicates it did not make an assigned copy of it.
That is NOT how it's
supposed to work. Assigning an external graphic object to the
Picture.Graphic property SHOULD create a new copy, not a reference.
... whereas a 'directly set graphic-object' results in a reference to said external graphic-object...
If that were true, that would be a serious deviation from Delphi compatibility.
When you directly assign an external graphic object to the
Picture.Graphic property, a COPY of that object should be created and become owned by the
Picture.Graphic property, freeing any previously owned object. This is exactly how
Picture.Graphic used to work a long time ago:
https://forum.lazarus.freepascal.org/index.php/topic,28874.msg181415.html#msg181415Likewise, when you
Assign() an external graphic object to the
Picture, a COPY of that object should be created and become owned by the
Picture.Graphic property, freeing any previously owned object.
And, when you
LoadFrom...() an external graphic file/stream into the
Picture, a new graphic object should be created and become owned by the
Picture.Graphic property, freeing any previously owned object.
So, either way, the
Picture.Graphic property should ALWAYS hold an independent object that is owned by
TPicture, allowing you to safely free any original external object you had assigned to the
Picture.
If that is not working correctly anymore, then that would be a bug that needs to be fixed.