Fix global info.desktop variables were incorrectly freed, sf #2876647
authorCesare Tirabassi <norsetto@ubuntu.com>
Mon, 12 Oct 2009 11:38:48 +0000 (13:38 +0200)
committerCesare Tirabassi <norsetto@ubuntu.com>
Mon, 12 Oct 2009 11:38:48 +0000 (13:38 +0200)
src/core.c

index 14a0f6c..2430cc5 100644 (file)
@@ -2492,11 +2492,11 @@ void free_text_objects(struct text_object *root, int internal)
                        case OBJ_desktop:
                        case OBJ_desktop_number:
                        case OBJ_desktop_name:
-                               if(info.x11.desktop.name) {
+                               if(info.x11.desktop.name && !internal) {
                                  free(info.x11.desktop.name);
                                  info.x11.desktop.name = NULL;
                                }
-                               if(info.x11.desktop.all_names) {
+                               if(info.x11.desktop.all_names && !internal) {
                                  free(info.x11.desktop.all_names);
                                  info.x11.desktop.all_names = NULL;
                                }