projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
285dfa0
)
Check for listeners in emit_exiting_event
author
Tom Tromey
<tromey@adacore.com>
Fri, 3 Jun 2022 16:39:11 +0000
(10:39 -0600)
committer
Tom Tromey
<tromey@adacore.com>
Wed, 15 Jun 2022 20:07:25 +0000
(14:07 -0600)
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.
gdb/python/python.c
patch
|
blob
|
history
diff --git
a/gdb/python/python.c
b/gdb/python/python.c
index 079c260fc7f3c900c9cb5a3ce20c605fc7ff5d78..7faad2bfa35c6518914696ca063b5f1651b8f1d4 100644
(file)
--- 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;