2.5
authorTon Roosendaal <ton@blender.org>
Mon, 8 Dec 2008 16:43:19 +0000 (16:43 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 8 Dec 2008 16:43:19 +0000 (16:43 +0000)
Minor cleanups.

source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_files.c

index 3333c485aaea025530e1dfba660015c9d92122fa..9e0408097d9d434742c6f3f6d1523b1f39689774 100644 (file)
@@ -74,11 +74,6 @@ void wm_operator_register(wmWindowManager *wm, wmOperator *op)
 {
        int tot;
 
-       if(op->ptr) {
-       //      MEM_freeN(op->ptr);
-       //      op->ptr= NULL;
-       }
-       
        BLI_addtail(&wm->operators, op);
        tot= BLI_countlist(&wm->operators);
        
@@ -130,7 +125,7 @@ void wm_add_default(bContext *C)
 }
 
 
-/* context is allowed to be NULL, do net free wm itself (library.c) */
+/* context is allowed to be NULL, do not free wm itself (library.c) */
 void wm_close_and_free(bContext *C, wmWindowManager *wm)
 {
        wmWindow *win;
index c74497fa10ba799f4b48393251e75fd5c985680c..1f5ed78ba5832dd83a7c8cc9156bee7d0aacda38 100644 (file)
@@ -310,9 +310,11 @@ int WM_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event)
 
                if((retval & OPERATOR_FINISHED) && (ot->flag & OPTYPE_REGISTER)) {
                        wm_operator_register(C->wm, op);
+                       handler->op= NULL;
                }
                else if(!(retval & OPERATOR_RUNNING_MODAL)) {
                        wm_operator_free(op);
+                       handler->op= NULL;
                }
        }
 
@@ -400,6 +402,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
                                handler->op= NULL;
                        }
                        
+                       
                        /* remove modal handler, operator itself should have been cancelled and freed */
                        if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
                                BLI_remlink(handlers, handler);
index b8a60710063b78ea5652108930195c02138b526e..75306dc75d84aa60e2b55dcb9b9ef2530d429f07 100644 (file)
@@ -872,7 +872,7 @@ int WM_write_homefile(bContext *C, wmOperator *op)
        write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN);
        BLO_write_file(C, tstr, write_flags, &err);
        
-       return 1;
+       return OPERATOR_FINISHED;
 }
 
 void WM_write_autosave(bContext *C)