Commit ac3c9134 authored by Claes Sjofors's avatar Claes Sjofors

rt_xtt memory leakage fixed

parent 1a78906c
......@@ -64,6 +64,7 @@ struct _BrowWidgetGtk {
gint scroll_timerid;
flow_sScroll scroll_data;
int scroll_configure;
int destroyed;
};
struct _BrowWidgetGtkClass {
......@@ -349,8 +350,14 @@ static void browwidgetgtk_destroy( GtkObject *object)
{
BrowWidgetGtk *brow = (BrowWidgetGtk *)object;
if ( brow->scroll_timerid)
g_source_remove( brow->scroll_timerid);
if ( !brow->destroyed) {
if ( brow->scroll_timerid)
g_source_remove( brow->scroll_timerid);
if ( !brow->is_navigator)
delete (FlowDrawGtk *)brow->draw_ctx;
brow->destroyed = 1;
}
GTK_OBJECT_CLASS( browwidgetgtk_parent_class)->destroy( object);
}
......@@ -383,6 +390,7 @@ GtkWidget *browwidgetgtk_new(
w->client_data = client_data;
w->scroll_h = 0;
w->scroll_v = 0;
w->destroyed = 0;
return (GtkWidget *) w;
}
......
......@@ -64,6 +64,7 @@ struct _FlowWidgetGtk {
gint scroll_timerid;
flow_sScroll scroll_data;
int scroll_configure;
int destroyed;
};
struct _FlowWidgetGtkClass {
......@@ -339,9 +340,14 @@ static void flowwidgetgtk_destroy( GtkObject *object)
{
FlowWidgetGtk *flow = (FlowWidgetGtk *)object;
if ( flow->scroll_timerid)
g_source_remove( flow->scroll_timerid);
if ( !flow->destroyed) {
if ( flow->scroll_timerid)
g_source_remove( flow->scroll_timerid);
if ( !flow->is_navigator)
delete (FlowDrawGtk *)flow->draw_ctx;
flow->destroyed = 1;
}
GTK_OBJECT_CLASS( flowwidgetgtk_parent_class)->destroy( object);
}
......@@ -371,6 +377,7 @@ GtkWidget *flowwidgetgtk_new(
w->client_data = client_data;
w->scroll_h = 0;
w->scroll_v = 0;
w->destroyed = 0;
return (GtkWidget *) w;
}
......
......@@ -267,6 +267,7 @@ static char *dyn_mask_to_bits( unsigned int value, int noofbits)
return str;
}
// Replace " to \"
char *GeDyn::cmd_cnv( char *instr)
{
......@@ -435,6 +436,16 @@ GeDyn::GeDyn( const GeDyn& x) :
// update_elements();
}
GeDyn::~GeDyn()
{
GeDynElem *elem, *next;
for ( elem = elements; elem; elem = next) {
next = elem->next;
delete elem;
}
}
void GeDyn::save( ofstream& fp)
{
fp << int(ge_eSave_Dyn) << endl;
......
......@@ -666,6 +666,8 @@ class GeDyn {
//! Copy constructor.
GeDyn( const GeDyn& x);
~GeDyn();
//! Get list of attributes.
/*!
\param object Object.
......
......@@ -66,6 +66,7 @@ struct _GrowWidgetGtk {
gint scroll_timerid;
glow_sScroll scroll_data;
int scroll_configure;
int destroyed;
};
struct _GrowWidgetGtkClass {
......@@ -269,10 +270,14 @@ static void growwidgetgtk_destroy( GtkObject *object)
{
GrowWidgetGtk *grow = (GrowWidgetGtk *)object;
if ( grow->scroll_timerid)
g_source_remove( grow->scroll_timerid);
if ( grow->is_navigator && grow->grow_ctx) {
((GrowCtx *)grow->grow_ctx)->no_nav = 1;
if ( !grow->destroyed) {
if ( grow->scroll_timerid)
g_source_remove( grow->scroll_timerid);
if ( grow->is_navigator && grow->grow_ctx)
((GrowCtx *)grow->grow_ctx)->no_nav = 1;
else
delete (GlowDrawGtk *)grow->draw_ctx;
grow->destroyed = 1;
}
GTK_OBJECT_CLASS( growwidgetgtk_parent_class)->destroy( object);
}
......@@ -388,6 +393,7 @@ GtkWidget *growwidgetgtk_new(
w->client_data = client_data;
w->scroll_h = 0;
w->scroll_v = 0;
w->destroyed = 0;
return (GtkWidget *) w;
}
......
......@@ -131,6 +131,7 @@ void GlowCtx::delete_all()
remove( element);
select_remove( element);
move_remove( element);
object_deleted( element);
delete element;
i--;
}
......
......@@ -125,7 +125,8 @@ XNavGtk::~XNavGtk()
for ( int i = 0; i < brow_cnt; i++) {
brow_stack[i]->free_pixmaps();
brow_DeleteSecondaryCtx( brow_stack[i]->ctx);
if ( i != 0)
brow_DeleteSecondaryCtx( brow_stack[i]->ctx);
delete brow_stack[i];
}
collect_brow->free_pixmaps();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment