Fix Buttons context, invalid object data access

Another instance of T44376.
Crash where the Python context would access a stale pointer to the active object.
This commit is contained in:
2015-05-04 18:02:56 +10:00
parent c9e5e81064
commit 74dc4e87a6
7 changed files with 47 additions and 68 deletions

View File

@@ -62,6 +62,7 @@
#include "ED_buttons.h"
#include "ED_image.h"
#include "ED_mesh.h"
#include "ED_node.h"
#include "ED_object.h"
#include "ED_outliner.h"
#include "ED_paint.h"
@@ -330,6 +331,7 @@ void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *ar, void *arg_info
*/
void ED_spacedata_id_unref(struct SpaceLink *sl, const ID *id)
{
switch (sl->spacetype) {
case SPACE_OUTLINER:
ED_outliner_id_unref((SpaceOops *)sl, id);
@@ -337,5 +339,8 @@ void ED_spacedata_id_unref(struct SpaceLink *sl, const ID *id)
case SPACE_BUTS:
ED_buttons_id_unref((SpaceButs *)sl, id);
break;
case SPACE_NODE:
ED_node_id_unref((SpaceNode *)sl, id);
break;
}
}