# HG changeset patch # User Sean Egan # Date 1021589202 0 # Node ID a7c24185421893ca9199a300bbf5e812a410e403 # Parent bea080f7f5c72ca0702299f3fb49b4d6d0b4c952 [gaim-migrate @ 3274] Fixed an applet memory leak. Serves me right for not reading the documentation. committer: Tailor Script diff -r bea080f7f5c7 -r a7c241854218 ChangeLog --- a/ChangeLog Thu May 16 02:13:45 2002 +0000 +++ b/ChangeLog Thu May 16 22:46:42 2002 +0000 @@ -5,7 +5,8 @@ * Squashed a bug in buddy right-click menu handling that crashed Gaim. In the process: found and eliminated some memory leaks. - + * Fixed a significant applet leak + version 0.58 (05/13/2002): * Bulgarian translation added (Thanks, Igel Itzo) * Taiwanese translation added (Thanks, Paladin Liu) diff -r bea080f7f5c7 -r a7c241854218 src/applet.c --- a/src/applet.c Thu May 16 02:13:45 2002 +0000 +++ b/src/applet.c Thu May 16 22:46:42 2002 +0000 @@ -72,18 +72,17 @@ gtk_widget_get_visual(applet)->depth); gc = gdk_gc_new(cache); gdk_gc_copy(gc, applet->style->bg_gc[GTK_WIDGET_STATE(applet)]); - path = gnome_pixmap_file(name); - if (path) + if (path) { scale = gdk_pixbuf_new_from_file(path); - g_free(path); + g_free(path); + } if (!scale) return NULL; pb = gdk_pixbuf_scale_simple(scale, sizehint, sizehint, GDK_INTERP_HYPER); gdk_pixbuf_unref(scale); - dst = g_new0(guchar, sizehint*sizehint*3); - applet_widget_get_rgb_bg(applet, &dst, &w, &h, &rowstride); + applet_widget_get_rgb_bg(APPLET_WIDGET(applet), &dst, &w, &h, &rowstride); art_affine_identity(affine); art_rgb_rgba_affine(dst, 0, 0, w, h, rowstride, @@ -335,8 +334,6 @@ applet = applet_widget_new("gaim_applet"); if (!applet) g_error(_("Can't create Gaim applet!")); - applet_widget_send_draw(applet, TRUE); - gtk_signal_connect(GTK_OBJECT(applet), "do-draw", GTK_SIGNAL_FUNC(update_applet), NULL); gtk_widget_set_events(applet, gtk_widget_get_events(applet) | GDK_BUTTON_PRESS_MASK); gtk_widget_realize(applet); @@ -368,6 +365,8 @@ GTK_SIGNAL_FUNC(applet_change_pixel_size), NULL); #endif + applet_widget_send_draw(applet, TRUE); + gtk_signal_connect(GTK_OBJECT(applet), "do-draw", GTK_SIGNAL_FUNC(update_applet), NULL); gtk_widget_show(icon); gtk_widget_show(applet); return 0;