changeset 33426:25faa5446214 stable tip

profile.m: Clear existing profile data when profiler enabled (bug #65595) * NEWS.9.md: Add description of bugfix to 9.2 release notes. * profile.m: In case "on", call __profiler_reset__ () before enabling profiler.
author Rik <rik@octave.org>
date Wed, 17 Apr 2024 15:25:34 -0700
parents 3e7059ae815c
children
files etc/NEWS.9.md scripts/profiler/profile.m
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS.9.md	Sun Apr 07 22:17:52 2024 +0200
+++ b/etc/NEWS.9.md	Wed Apr 17 15:25:34 2024 -0700
@@ -15,6 +15,8 @@
   (bug #65442)
 - `savepath.m`: Correctly handle packages without binaries (bug #65559).
 - Correctly scale figure position on screen with DPI scaling (high DPI).
+- `profile ('on')` now clears any existing profile data as the documentation
+  states (bug #65595).
 
 ### GUI
 
--- a/scripts/profiler/profile.m	Sun Apr 07 22:17:52 2024 +0200
+++ b/scripts/profiler/profile.m	Wed Apr 17 15:25:34 2024 -0700
@@ -74,6 +74,10 @@
 
   switch (arg)
     case "on"
+      if (__profiler_enable__ ())
+        __profiler_enable__ (false);
+      endif
+      __profiler_reset__ ();
       __profiler_enable__ (true);
 
     case "off"