Crash when editing nickname

Dirk Hohndel dirk at hohndel.org
Sat Jan 19 14:05:27 PST 2013


Henrik Brautaset Aronsen <subsurface at henrik.synth.no> writes:

> 1) Open the nickname list (must have 2 or more entries)
> 2) Delete one of the entries (The list window closes?!)
> 3) Re-open the nickname list
> 4) Edit a nickname and press Apply
>
> *BOOM*
>
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0   subsurface                        0x0000000103adb303 
> edit_dc_nicknames + 2227 (gtk-gui.c:1274)
> 1   libgobject-2.0.0.dylib            0x000000010474ebc4 
> g_closure_invoke + 308

This seems to fix it.

Amit, can you confirm that this is a smart way to address the issue (I'm
not 100% certain how the flow is supposed to work in this case - but it
seems to work with this change)

Thanks

/D

diff --git a/gtk-gui.c b/gtk-gui.c
index 7a8f10c..29a77b6 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -1271,7 +1271,7 @@ static void edit_dc_nicknames(GtkWidget *w, gpointer data)
                        }
                        gtk_widget_destroy(confirm);
                }
-               if (res == GTK_RESPONSE_APPLY && holdnicknames->model != NULL ) {
+               if (res == GTK_RESPONSE_APPLY && holdnicknames && holdnicknames->model != NULL ) {
                        struct device_info * walk = holdnicknames;
                        struct device_info * release = holdnicknames;
                        struct device_info * track = holdnicknames->next;




More information about the subsurface mailing list