You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Delphi 10.4, package downloaded via GetIt. Build of x64 DLL.
As title stated, exception is thrown when RevertPatchedMethods is called on disposing DataModule in which TPngImageList is contained. This happens to me only during DLL registration via regsvr32.exe with /S switch. With no /S switch it is not triggered. I suspect that patched references are disposed before method is called in final memory cleanup of memory manager.
I also suspect unit PngImageListfinalization section to not properly handle marking of disposed MethodPatches. Variable ImageListCount in such situation should be set to eg. negative value or MethodPatches should be set to nil and RevertPatchedMethods should check if reference is nil for MethodPatches.
I would like to remind that double freeing of an object is programming bug (silenced in x86; raises exception in x64). Also finalization section should check if MethodPatches is nil, as calling Free on nil is also a bug.
This can be prevented right now by declaring proper initialization/finalization section in DataModule auto generated code which by default use units begin section with no finalization.
The text was updated successfully, but these errors were encountered:
Using Delphi 10.4, package downloaded via GetIt. Build of x64 DLL.
As title stated, exception is thrown when RevertPatchedMethods is called on disposing DataModule in which TPngImageList is contained. This happens to me only during DLL registration via regsvr32.exe with /S switch. With no /S switch it is not triggered. I suspect that patched references are disposed before method is called in final memory cleanup of memory manager.
I also suspect unit PngImageList finalization section to not properly handle marking of disposed MethodPatches. Variable ImageListCount in such situation should be set to eg. negative value or MethodPatches should be set to nil and RevertPatchedMethods should check if reference is nil for MethodPatches.
I would like to remind that double freeing of an object is programming bug (silenced in x86; raises exception in x64). Also finalization section should check if MethodPatches is nil, as calling Free on nil is also a bug.
This can be prevented right now by declaring proper initialization/finalization section in DataModule auto generated code which by default use units begin section with no finalization.
The text was updated successfully, but these errors were encountered: