changeset 28341:809c61402196 stable

Catch error on setting properties during figure creation (bug #54953). * graphics.cc (F__go_figure): Catch error on setting figure properties and delete incomplete graphics object.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 21 May 2020 11:49:03 +0200
parents e491e751c356
children b95dbd889f1a 8b71a6cec9bf
files libinterp/corefcn/graphics.cc
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc	Thu May 21 12:51:43 2020 +0200
+++ b/libinterp/corefcn/graphics.cc	Thu May 21 11:49:03 2020 +0200
@@ -13195,11 +13195,20 @@
       if (! h.ok ())
         error ("__go_figure__: failed to create figure handle");
 
+      try
+        {
+          xset (h, xargs);
+        }
+      catch (octave::execution_exception& e)
+        {
+          delete_graphics_object (h);
+          error (e, "__go_figure__: unable to create figure handle");
+        }
+
       adopt (0, h);
 
       gh_mgr.push_figure (h);
 
-      xset (h, xargs);
       xcreatefcn (h);
       xinitialize (h);