aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-06-03 10:39:11 -0600
committerTom Tromey <tromey@adacore.com>2022-06-15 14:07:25 -0600
commit9d741cbedb8a7a77bb7c99bbbc363d5af4ba62c2 (patch)
treea1effc6fdb0e80899cf9d132c0045c199f6ee236 /gdb/python
parent285dfa0f6877ea7677e84c3c1001c5d339fbbe5e (diff)
downloadgdb-9d741cbedb8a7a77bb7c99bbbc363d5af4ba62c2.zip
gdb-9d741cbedb8a7a77bb7c99bbbc363d5af4ba62c2.tar.gz
gdb-9d741cbedb8a7a77bb7c99bbbc363d5af4ba62c2.tar.bz2
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.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/python.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 079c260..7faad2b 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -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;