Workaround for deleting a lattice object in an operator related crash?


I filed this bug, which is about an undo done by the user after a lattice object is deleted by an operator causes a crash.

I am wondering if there is a work around for the given bug until it is fixed? I was about to release my addon but now I feel like I cant because well I do not want users crashing Blender and loosing their work.

There is a simple sample add-on that causes the crash and how to steps in the bug report.


There is a recommendation by Joseph Eagar (joeedh) which overcomes the crashes I explained in my top post.

If you are facing a similar issue here is the recommended solution which works with my initial testing, I am hoping that I wont face any more surprises with this issue.

Okay, looks like the problem is with the undo system; if you manually exit editmode then push the understack, e.g.: