Subject: Possible leak ? (UNIX)
From: Hubert Figuiere (hfiguiere@teaser.fr)
Date: Mon Jan 29 2001 - 17:48:30 CST
In ev_UnixMenu.cpp, around line 485, there is this code:
// create callback info data for action handling
_wd * wd = new _wd(this, id);
UT_ASSERT(wd);
// find parent menu item
GtkWidget * wParent;
bResult = stack.viewTop((void **)&wParent);
UT_ASSERT(bResult);
gtk_object_set_data(GTK_OBJECT(wMenuRoot), szLabelName, w);
// bury in parent
gtk_menu_append(GTK_MENU(wParent), w);
// connect callbacks
gtk_signal_connect(GTK_OBJECT(w), "activate",
GTK_SIGNAL_FUNC(_wd::s_onActivate), wd);
gtk_signal_connect(GTK_OBJECT(w), "select",
GTK_SIGNAL_FUNC(_wd::s_onMenuItemSelect), wd);
gtk_signal_connect(GTK_OBJECT(w), "deselect",
GTK_SIGNAL_FUNC(_wd::s_onMenuItemDeselect), wd);
Nowhere I see wd being freeed when w is deleted... Since there is not
signal_connect to the destroy signal, I suspect it really is the
case. So if we build a lot of ev_UnixMenu and free them, all memory
don't get reclaimed.
Does anyone infirm or confirm this ?
Hub
This archive was generated by hypermail 2b25 : Mon Jan 29 2001 - 17:48:33 CST