Search the web
Sign In
New User? Sign Up
gbuffy · GBuffy Tool Discussion
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Bug -- delete mailbox results in strangeness   Message List  
Reply | Forward Message #62 of 231 |
Re: Bug -- delete mailbox results in strangeness

I found (and fixed) the bug. The problem occurs only when deleting the FIRST
mailbox, because in that situation the MailboxInfo linked list is not
reassigned.

The enclosed patch contains the fix, plus some code to minimize memory leaks
when deleting mailboxes, plus one very minor GTK+ typecast in gbuffy.c.

Ethan Glasser-Camp, self-styled Computersman


Fri Jun 6, 2003 6:01 pm

glasserc2
Offline Offline
Send Email Send Email

diff -u gbuffy-0.2.5/gbconfig.c newgbuffy/gbconfig.c
--- gbuffy-0.2.5/gbconfig.c Wed Mar 21 22:25:06 2001
+++ newgbuffy/gbconfig.c Fri Jun 6 13:57:42 2003
@@ -267,24 +267,68 @@
gtk_clist_select_row (GTK_CLIST (MailboxCList), x, 0);
}

+void box_free(BOX_INFO * box){
+ if (box->title)
+ FREE (&box->title);
+ if (box->path)
+ FREE (&box->path);
+ if (box->command)
+ FREE (&box->command);
+ if (box->server)
+ FREE (&box->server);
+ if (box->login)
+ FREE (&box->login);
+ if (box->pass)
+ FREE (&box->pass);
+ if (box->newsrc)
+ FREE (&box->newsrc);
+ if (box->w)
+ {
+ gtk_widget_destroy(GTK_WIDGET (box->w));
+ box->w = NULL;
+ }
+ if (box->button)
+ {
+ /* Should destroy the button, but for now forget it because it disrupts
+ the interface. */
+ /* Might be able to forget about it, in point of fact, because the call
+ to gtk_widget_destroy(MainWindow) should free up that memory. */
+ /* gtk_widget_destroy (GTK_WIDGET (box->button)); */
+ box->button = NULL;
+ }
+ if (box->headers)
+ {
+ g_list_free (box->headers);
+ }
+ if (box->pixmap)
+ gdk_pixmap_unref (box->pixmap);
+}
+
static void configure_delete (GtkWidget *button, gpointer data)
{
BOX_INFO *box, *last;
int row = 0;

last = box = MailboxInfo;
+ while(box != NULL && box->selected)
+ {
+ gtk_clist_remove(GTK_CLIST (MailboxCList), row);
+ box_free (box);
+ MailboxInfo = box->next;
+ last = box;
+ box = box->next;
+ free (last);
+ }
+
+ last = box;
while (box != NULL)
{
if (box->selected)
{
gtk_clist_remove (GTK_CLIST (MailboxCList), row);
- if (box->title)
- free (box->title);
- if (box->path)
- free (box->path);
- if (box->command)
- free (box->command);
+ box_free (box);
last->next = box->next;
+ free (box);
box = last->next;
}
else
Only in newgbuffy/: gbuffy
diff -u gbuffy-0.2.5/gbuffy.c newgbuffy/gbuffy.c
--- gbuffy-0.2.5/gbuffy.c Sun Oct 21 16:57:00 2001
+++ newgbuffy/gbuffy.c Thu Jun 5 22:50:48 2003
@@ -650,7 +650,7 @@
if (MainWindow != NULL)
{
DontExit = TRUE;
- gtk_widget_destroy (MainWindow);
+ gtk_widget_destroy (GTK_WIDGET (MainWindow));
}
MainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
#endif
Common subdirectories: gbuffy-0.2.5/libcompface and newgbuffy/libcompface


Forward
Message #62 of 231 |
Expand Messages Author Sort by Date

Just a couple of quick things. I'm using the Debian package gbuffy 0.2.4-3 and it looks pretty cool. My setup, as it just was, had four mailboxes: the default...
glasserc2
Offline Send Email
Jun 5, 2003
6:54 pm

That is a weird error... The config file is in one of two places: ~/.gbuffyrc or ~/GNUstep/Defaults/GBuffy You can just remove the first section. There are...
Brandon Long
blong42
Offline Send Email
Jun 5, 2003
6:57 pm

I found (and fixed) the bug. The problem occurs only when deleting the FIRST mailbox, because in that situation the MailboxInfo linked list is not reassigned. ...
Ethan Glasser-Camp
glasserc2
Offline Send Email
Jun 6, 2003
6:01 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help