Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
BUG: Memory Leak at cbProject::VirtualFolderAdded
lights_joy:
--- Quote ---BTW: Some one may be interested to see a VC project file for C::B source code, how do you did that? Share it? Thanks.
--- End quote ---
sure, of cause i can share the vs project after i compile all the code of 12.11.
there is still something wrong in my project, and there are still some memory leak in the project, so I must view and debug now.
MortenMacFly:
Honestly: I am not sure if this is really an issue: The FileTreeData is user data attached to a UI element in the project tree. IMHO it gets automatically destroyed if the UI (and therefore this element) is being removed.
You should consult the wxWidgets docs accordingly.
Edit: See here:
http://docs.wxwidgets.org/trunk/classwx_tree_item_data.html
Especially:
--- Quote ---The main advantage of having this class is that wxTreeItemData objects are destroyed automatically by the tree and, as this class has virtual destructor, it means that the memory and any other resources associated with a tree item will be automatically freed when it is deleted.
--- End quote ---
lights_joy:
the wxTreeItemData object will be destroyed only when it's attached to a FileTreeItem,
but in the code here, the ftd is not attached to any FileTreeItem, so it will NOT freed automatically.
MortenMacFly:
--- Quote from: lights_joy on January 22, 2014, 03:55:48 pm ---the wxTreeItemData object will be destroyed only when it's attached to a FileTreeItem,
but in the code here, the ftd is not attached to any FileTreeItem, so it will NOT freed automatically.
--- End quote ---
What do you think does "AddTreeNode(tree, foldername, m_ProjectNode, true, FileTreeData::ftdkVirtualFolder, true, vfldIdx, ftd);" do?
stahta01:
--- Quote from: MortenMacFly on January 22, 2014, 06:18:01 pm ---
--- Quote from: lights_joy on January 22, 2014, 03:55:48 pm ---the wxTreeItemData object will be destroyed only when it's attached to a FileTreeItem,
but in the code here, the ftd is not attached to any FileTreeItem, so it will NOT freed automatically.
--- End quote ---
What do you think does "AddTreeNode(tree, foldername, m_ProjectNode, true, FileTreeData::ftdkVirtualFolder, true, vfldIdx, ftd);" do?
--- End quote ---
I think the issue is inside this function; but, I do NOT know enough C++ to be sure. And the OP is NOT very clear in his posts.
FileTreeData* CompilerGCC::DoSwitchProjectTemporarily() in the file src\plugins\compilergcc\compilergcc.cpp
Edit: But, I thought C++ use of new() let this stuff work better than C malloc; the OP complaining about malloc implies he is not a C++ person also.
So, if you say it right its enough for me.
Tim S.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version