THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/12/2011 at 08:59, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C++ ;
---------
While checking my plugin code for memory leaks. I discovered that using Init(GeGetPluginPath()) in my CreateLayout() function is not letting go of some memory.
Here is the message displayed by the c4d_debug.txt debugger:
gui_newdialog.c<731>: 104 bytes at 19272928!
1 Blocks
*** Potential Memory Leak Detected ***
The plugin is a GeDialog type plugin. But it uses external resource files instead of the built-in AddGizmo() style.
Code Snippet:
Bool myDialog::CreateLayout(void)
{
Bool result = TRUE;
GeResource dlg_res;
dlg_res.Init(GeGetPluginPath()); // <---This code creates a memory leak!!
result = LoadDialogResource(IDS_RESDIALOG, &dlg_res, 0); //IDS_RESDIALOG is the items found in the .res file
//GUI stuff here
return TRUE;
}
I'm new at memory management. And I've never seen init() cause a memory problem before.
How do I free this so it doesn't show up in the debugger as a leak?
-ScottA