Fix T57831: Crash with multi-select / delete of the same object in Collection outliner.

Tssst… that piece of code should have been removed when we got rid of
bases here, kind of obvious it would break if object pointer itself is
NULL! And since deleting an object clears its ID pointers in outliner
tree, this fixes for free the issue of deleting several time the same
object (being selected in several collections at once).
This commit is contained in:
Bastien Montagne 2018-11-15 12:24:51 +01:00
parent e318da5350
commit d2c41293a0
Notes: blender-bot 2023-02-14 05:01:23 +01:00
Referenced by issue #57831, Crash with multi-select / delete of the same object in Collection outliner
1 changed files with 2 additions and 9 deletions

View File

@ -430,8 +430,8 @@ static void object_deselect_cb(
}
static void object_delete_cb(
bContext *C, ReportList *reports, Scene *scene, TreeElement *te,
TreeStoreElem *tsep, TreeStoreElem *tselem, void *user_data)
bContext *C, ReportList *reports, Scene *scene, TreeElement *UNUSED(te),
TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, void *UNUSED(user_data))
{
Object *ob = (Object *)tselem->id;
if (ob) {
@ -460,13 +460,6 @@ static void object_delete_cb(
tselem->id = NULL;
#endif
}
else {
/* No base, means object is no more instantiated in any scene.
* Should not happen ideally, but does happens, see T51625.
* Rather than twisting in all kind of ways to address all possible cases leading to that situation, simpler
* to allow deleting such object as a mere generic data-block. */
id_delete_cb(C, reports, scene, te, tsep, tselem, user_data);
}
}
static void id_local_cb(