diff options
author | Tom Tromey <tromey@adacore.com> | 2024-02-23 13:24:03 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2024-02-27 10:30:29 -0700 |
commit | ec471b627aa76fa8ac1f103ecabd73e304e952c8 (patch) | |
tree | 4c9a42d2f8de916023664f719ef10218a94c266d /gdb/value.c | |
parent | beadf912845c9c37c5afeadd77635950cf697d9f (diff) | |
download | fsf-binutils-gdb-ec471b627aa76fa8ac1f103ecabd73e304e952c8.zip fsf-binutils-gdb-ec471b627aa76fa8ac1f103ecabd73e304e952c8.tar.gz fsf-binutils-gdb-ec471b627aa76fa8ac1f103ecabd73e304e952c8.tar.bz2 |
Change finalize_values into a final cleanup
This removes finalize_values in favor of adding a new final cleanup.
This is safe now that extension languages are explicitly shut down.
Diffstat (limited to 'gdb/value.c')
-rw-r--r-- | gdb/value.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gdb/value.c b/gdb/value.c index c7e940b..a2b2721 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -4499,12 +4499,13 @@ and exceeds this limit will cause an error."), selftests::test_insert_into_bit_range_vector); selftests::register_test ("value_copy", selftests::test_value_copy); #endif -} - -/* See value.h. */ -void -finalize_values () -{ - all_values.clear (); + /* Destroy any values currently allocated in a final cleanup instead + of leaving it to global destructors, because that may be too + late. For example, the destructors of xmethod values call into + the Python runtime. */ + add_final_cleanup ([] () + { + all_values.clear (); + }); } |