Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

wxFlatNotebook update + Patch

<< < (3/7) > >>

killerbot:
editormanager adjust is in svn, should wxFNB also not be updated then in svn ?
We might have a leak without the destroy and the old wxFNB ?

mandrav:

--- Quote from: killerbot on May 05, 2006, 03:23:36 pm ---editormanager adjust is in svn, should wxFNB also not be updated then in svn ?

--- End quote ---

Not until I test it under Linux...


--- Quote from: killerbot on May 05, 2006, 03:23:36 pm ---We might have a leak without the destroy and the old wxFNB ?

--- End quote ---

We can live with it for a few hours, I guess ;)

sethjackson:
Umm wouldn't this be more appropriate in the EditorManager destructor?


--- Code: (cpp) ---if (m_pNotebook)
    m_pNotebook->Destroy();

--- End code ---

Please pardon my ignorance if this is bad code......  :lol:

Der Meister:
If I understand thomas correctly this would not solve the problem because the editormagager would destroy the notebook as the pointer is valid (and it should be valid as the old line didn't crash) and *after that* wxFND would try to destroy this notebook again and this will crash - no matter if you check the m_pNotebook pointer in editormanager or not.

yop:
Also it's totaly legal to "delete" a null pointer. All the problems arise from the fact that including myself many forget to set the pointer to null after deletion.
From: http://www.cplusplus.com/doc/tutorial/dynamic.html

--- Quote ---The value passed as argument to delete must be either a pointer to a memory block previously allocated with new, or a null pointer (in the case of a null pointer, delete produces no effect).
--- End quote ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version