July 23, 2005 Doc suggestion - change in "D for Win32" section | ||||
---|---|---|---|---|
| ||||
I was running into some memory leaks in one of my Win32 programs in D recently. I did some testing, and realized that memory that was being allocated in module ctors (static this()es) was never being deallocated, and that the module dtors were never being run. I was using the WinMain template described in the "D for Win32" section of the help, and upon closer inspection, that code doesn't call the module dtors. So, I suggest that the following extern line be added: extern (C) void _moduleDtor(); And after the line result = myWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow); The line _moduleDtor(); Should be added. Hoping to prevent others from dealing with this in the future! |
July 23, 2005 Re: Doc suggestion - change in "D for Win32" section | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Good catch. Done. -Walter |
Copyright © 1999-2021 by the D Language Foundation