Minor cleanups.
{
int tot;
- if(op->ptr) {
- // MEM_freeN(op->ptr);
- // op->ptr= NULL;
- }
-
BLI_addtail(&wm->operators, op);
tot= BLI_countlist(&wm->operators);
}
-/* 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;
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;
}
}
handler->op= NULL;
}
+
/* remove modal handler, operator itself should have been cancelled and freed */
if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
BLI_remlink(handlers, handler);
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)