From ab655cf8ec35ab47a38d95182dfe07a0e380681a Mon Sep 17 00:00:00 2001 From: dsmith Date: Mon, 19 Mar 2007 21:14:21 +0000 Subject: 2007-03-19 David Smith PR 4146 (partial fix) * tapsets.cxx (all_session_groups): Added note about stating that begin probes should be registered (actually run) first and end probes should be unregistered (run) last. * translate.cxx (c_unparser::emit_module_exit): Process probe group vector in reverse order so that probe groups will get unregistered in the reverse order that they were registered. --- translate.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'translate.cxx') diff --git a/translate.cxx b/translate.cxx index 36530373..89a961e3 100644 --- a/translate.cxx +++ b/translate.cxx @@ -1201,9 +1201,13 @@ c_unparser::emit_module_exit () // XXX: might like to have an escape hatch, in case some probe is // genuinely stuck somehow + // Notice we're processing the derived_probe_group list in reverse + // order. This ensures that probes get unregistered in reverse + // order of the way they were registered. vector g = all_session_groups (*session); - for (unsigned i=0; iemit_module_exit (*session); // NB: runs "end" probes + for (vector::reverse_iterator i = g.rbegin(); + i != g.rend(); i++) + (*i)->emit_module_exit (*session); // NB: runs "end" probes for (unsigned i=0; iglobals.size(); i++) { -- cgit