Fix: Memory leak in purge orphans with no unused data-blocks

Operator cutom data was allocated but not freed in the early return.
This commit is contained in:
Hans Goudey 2024-06-18 23:49:18 -04:00
parent ad625d8dc4
commit 86e1ef2e31

View file

@ -2288,6 +2288,8 @@ static int outliner_orphans_purge_exec(bContext *C, wmOperator *op)
if (data.num_total[INDEX_ID_NULL] == 0) {
BKE_report(op->reports, RPT_INFO, "No orphaned data-blocks to purge");
MEM_delete(static_cast<LibQueryUnusedIDsData *>(op->customdata));
op->customdata = nullptr;
return OPERATOR_CANCELLED;
}