Check for listeners in emit_exiting_event
I noticed that emit_exiting_event does not check whether there are any listeners before creating the event object. All other event emitters do this, so this patch updates this one as well.
This commit is contained in:
parent
285dfa0f68
commit
9d741cbedb
1 changed files with 3 additions and 0 deletions
|
@ -1938,6 +1938,9 @@ init__gdb_module (void)
|
|||
static int
|
||||
emit_exiting_event (int exit_code)
|
||||
{
|
||||
if (evregpy_no_listeners_p (gdb_py_events.gdb_exiting))
|
||||
return 0;
|
||||
|
||||
gdbpy_ref<> event_obj = create_event_object (&gdb_exiting_event_object_type);
|
||||
if (event_obj == nullptr)
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue