DRW: DebugDraw: Fix unguarded drw_debug_draw()
This might create nullptr dereference in some cases.
This commit is contained in:
@@ -595,11 +595,13 @@ blender::draw::DebugDraw *DRW_debug_get()
|
||||
|
||||
void drw_debug_draw()
|
||||
{
|
||||
if (!GPU_shader_storage_buffer_objects_support()) {
|
||||
#ifdef DEBUG
|
||||
if (!GPU_shader_storage_buffer_objects_support() || DST.debug == nullptr) {
|
||||
return;
|
||||
}
|
||||
/* TODO(fclem): Convenience for now. Will have to move to DRWManager. */
|
||||
reinterpret_cast<blender::draw::DebugDraw *>(DST.debug)->display_to_view();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -3029,6 +3029,7 @@ void DRW_engines_free(void)
|
||||
DRW_globals_free();
|
||||
|
||||
drw_debug_module_free(DST.debug);
|
||||
DST.debug = NULL;
|
||||
|
||||
DRW_UBO_FREE_SAFE(G_draw.block_ubo);
|
||||
DRW_UBO_FREE_SAFE(G_draw.view_ubo);
|
||||
|
Reference in New Issue
Block a user