- changed status to resolved
Unsafe call to OleUninitialize in fpGUI's finalization section
HTML Tag 1.3 added a form component provided by the fpGUI toolkit. This library was chosen over the LCL to keep binaries lightweight.
I know from forum posts and other plugin projects that LCL components can be safely initialized and destroyed in the context of DllMain
. Turns out that is not the case with fpGUI. Its components are specifically intended for standalone graphics applications, and include features provided by combase.dll
, such as "drag and drop". To use the required COM libraries, the GDI wrapper calls OleInitialize
and OleUninitialize
(*1). Microsoft's documentation explicitly warns against calling these functions from DllMain
, since
there is no way to control the order in which in-process servers are loaded or unloaded.
Sure enough, I noticed that a recent version of HTML Tag was making Notepad++ take slightly longer to shut down. The mouse cursor would spin for a second after the application window disappeared. The debugger found the problem in the DLL unloading phase; those brief pauses during shutdown were exception events like this one:
AppName notepad++.exe
AppVersion 8.4.4.0
AppTimeStamp 62d18e06
ModuleName combase.dll
ModuleVersion 10.0.22621.317
ModuleTimeStamp a0fb7b18
ExceptionCode c0000602
FaultingOffset 0000000000056f59
ProcessId 0x1d60
ProcessCreationTime 0x1d8b283b1f3819b
AppPath ..........
ModulePath C:\WINDOWS\System32\combase.dll
IntegratorReportId 06f1d928-e65c-432a-b407-ccdf84425b66
PackageFullName
PackageRelativeAppId
These crashes occur late in the application life-cycle and do not pose any risk to user data.
A bugfix release will appear soon.
Comments (1)
-
reporter - Log in to comment
Avoid unsafe call to OleUninitialize
Fixes
#4→ <<cset 228668807a6e>>