diff options
Diffstat (limited to 'source/blender/editors/space_api')
-rw-r--r-- | source/blender/editors/space_api/spacetypes.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 817760615df..c112c678a09 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -272,6 +272,22 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type) } } +void ED_region_draw_cb_remove_by_type(ARegionType *art, void *draw_fn, void (*free)(void *)) +{ + RegionDrawCB *rdc = art->drawcalls.first; + while (rdc) { + RegionDrawCB *rdc_next = rdc->next; + if (rdc->draw == draw_fn) { + if (free) { + free(rdc->customdata); + } + BLI_remlink(&art->drawcalls, rdc); + MEM_freeN(rdc); + } + rdc = rdc_next; + } +} + /* ********************* space template *********************** */ /* forward declare */ void ED_spacetype_xxx(void); |