Minor cleanups.
This commit is contained in:
Ton Roosendaal
2008-12-08 16:43:19 +00:00
parent 02e23c16dd
commit dc50e7fd3c
3 changed files with 5 additions and 7 deletions

View 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;

View 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);

View 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)