Hello All,
I'm facing in some rare cases the "Warning, memory allocated but not
released: 1124 bytes (16 block(s))" due to the unfreed allocate HB
ITEM. For some unknown reason, when gtk is terminated abnormally, it
doesn't call the gc closure notify. Here are some examples that I'm
using for:
void xhgtk_signal_destroy(gpointer data)
{
hb_itemRelease( (PHB_ITEM) data );
}
void Callback( GtkWidget *widget, gpointer data )
{
PHB_ITEM pWidget;
pWidget = hb_itemPutPtr( NULL, (GtkWidget *) widget );
hb_vmEvalBlockV( (PHB_ITEM) data, 1, pWidget );
hb_itemRelease( pWidget );
}
gulong xhgtk_signal_connect( GConnectFlags connect_flags )
{
PHB_ITEM pBlock = hb_itemNew(hb_param( 3, HB_IT_BLOCK | HB_IT_BYREF ));
gulong result = 0L;
result = g_signal_connect_data
(
G_OBJECT( (GtkWidget *) hb_parptr(1)),
hb_parcx(2),
G_CALLBACK(Callback_KeyPressEvent),
pBlock,
(GClosureNotify) xhgtk_signal_destroy,
connect_flags
);
return result;
}
So the one million question is. Is there any way on Callback()
function to use the Harbour GC to free up the allocated when it's
completed, then I would not need rely on GTK Closure notify? Any
suggestions?
Thanks in advance
Rodrigo
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour