Print Page | Close Window

Library not free'ed

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6618
Printed Date: 12 November 2025 at 9:47am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Library not free'ed
Posted By: danpetitt
Subject: Library not free'ed
Date Posted: 11 March 2007 at 2:29am
I see that the RichEdit library is not being free'ed in deconstruction.

CRichEditContext::CRichEditContext()

{
m_hInstance = LoadLibraryA("RICHED20.DLL");
....


Also, I dont think the "UxTheme.dll" is being free'ed either.

I am running an older version of BoundsChecker so its possible, its a mistake.



Replies:
Posted By: Oleg
Date Posted: 12 March 2007 at 1:56am
Hi,
Yes, for static objects we don't call FreeLibrary intended , because destructors of static objects will be called in DlllMain and MSDN say : "It is not safe to call FreeLibrary from DllMain"


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: danpetitt
Date Posted: 12 March 2007 at 4:43am
I see, I thought you might call a "Cleanup" function at a known shutdown point rather than rely on a normal static deconstruction which happen in an unknown order and cause issues.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net