diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-07-19 08:50:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-07-19 08:50:10 +0400 |
commit | 7411a86a41c654ff0ea6769a8130707a6baadac4 (patch) | |
tree | c19d0169d75a25be449587c6e15a526d2e20e291 /source/blender | |
parent | aad1f809dd1a494cd5e36f585e5029195c712942 (diff) |
- was freeing reports on freed listbases
- free reports in a single loop.
- extrude was using a NULL scene, crashed when used as a macro
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/report.c | 12 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 3 |
3 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index 3e3dd4b0af0..391adfb762a 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -73,15 +73,21 @@ void BKE_reports_init(ReportList *reports, int flag) void BKE_reports_clear(ReportList *reports) { - Report *report; + Report *report, *report_next; if(!reports) return; - for(report=reports->list.first; report; report=report->next) + report= reports->list.first; + + while (report) { + report_next= report->next; MEM_freeN(report->message); + MEM_freeN(report); + report= report_next; + } - BLI_freelistN(&reports->list); + reports->list.first= reports->list.last= NULL; } void BKE_report(ReportList *reports, ReportType type, const char *message) diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index e16adf8ab2e..3c186659adc 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -622,9 +622,8 @@ void hashvert_flag(EditMesh *em, int flag) } /* generic extern called extruder */ -void extrude_mesh(Object *obedit, EditMesh *em, wmOperator *op) +void extrude_mesh(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op) { - Scene *scene= NULL; // XXX CTX! float nor[3]= {0.0, 0.0, 0.0}; short nr, transmode= 0; @@ -704,7 +703,7 @@ static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *event) EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); int constraint_axis[3] = {0, 0, 1}; - extrude_mesh(obedit,em, op); + extrude_mesh(scene, obedit, em, op); BKE_mesh_end_editmesh(obedit->data, em); @@ -731,7 +730,7 @@ static int mesh_extrude_exec(bContext *C, wmOperator *op) Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(obedit->data); - extrude_mesh(obedit,em, op); + extrude_mesh(scene, obedit, em, op); DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 94218c10c9a..5c34b19c1f4 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -227,6 +227,7 @@ void WM_exit(bContext *C) fastshade_free_render(); /* shaded view */ ED_preview_free_dbase(); /* frees a Main dbase, before free_blender! */ + wm_free_reports(C); /* before free_blender! - since the ListBases get freed there */ free_blender(); /* blender.c, does entire library and spacetypes */ // free_matcopybuf(); free_anim_copybuf(); @@ -270,8 +271,6 @@ void WM_exit(bContext *C) RNA_exit(); - wm_free_reports(C); - CTX_free(C); if(MEM_get_memory_blocks_in_use()!=0) { |