From d930d06e3fd1c821a020561a8cc583db005f7c10 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 13 Oct 2011 14:54:14 +0000 Subject: [PATCH] * python/py-breakpoint.c (gdbpy_breakpoint_deleted): Ensure GIL is always released. --- gdb/ChangeLog | 5 +++++ gdb/python/py-breakpoint.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index aa8a10566f9..2251b08e36f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-10-13 Tom Tromey + + * python/py-breakpoint.c (gdbpy_breakpoint_deleted): Ensure GIL is + always released. + 2011-10-13 Tom Tromey * python/py-type.c (typy_has_key): Make 'field' const. diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index 3dc0fcacbeb..87265e269f3 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -841,15 +841,15 @@ gdbpy_breakpoint_deleted (struct breakpoint *b) state = PyGILState_Ensure (); bp = get_breakpoint (num); - if (! bp) - return; - - bp_obj = bp->py_bp_object; - if (bp_obj) + if (bp) { - bp_obj->bp = NULL; - --bppy_live; - Py_DECREF (bp_obj); + bp_obj = bp->py_bp_object; + if (bp_obj) + { + bp_obj->bp = NULL; + --bppy_live; + Py_DECREF (bp_obj); + } } PyGILState_Release (state); } -- 2.30.2