Bug 128374 - Crash when trying to modify a legend
Summary: Crash when trying to modify a legend
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Solaris
: NOR crash
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-31 14:49 UTC by Nicolas Brisset
Modified: 2006-05-31 15:12 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Brisset 2006-05-31 14:49:53 UTC
Version:           1.3.0_devel (using KDE 3.4.0, compiled sources)
Compiler:          gcc version 3.4.3
OS:                SunOS (sun4u) release 5.8

While trying to figure out how legends should work, I triggered a crash which someone had apparently been expecting :-)
Assertion failed: !_menu, file kstviewwidget.cpp, line 327


To reproduce:
1) load all 3 columns from gyrodata.dat into a single plot
2) make it show the legend
3) RMB on the legend, call "Modify" to open the legend dialog
4) while the dialog is shown, repeat RMB on the legend

It seems it does not crash when the dialog has been called from within the plot dialog (though I'm not sure it is 100% true)
Comment 1 George Staikos 2006-05-31 15:12:43 UTC
SVN commit 546935 by staikos:

Ok now I see how this can happen.  Don't allow recursive menus at all.  It's too
dangerous.
BUG: 128374


 M  +4 -1      kstviewwidget.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/kstviewwidget.cpp #546934:546935
@@ -324,7 +324,10 @@
   if (_view->mouseGrabber()) {
     _view->releaseMouse(_view->mouseGrabber());
   }
-  assert(!_menu);
+  if (_menu) { // Do not allow recursive menus
+    e->ignore();
+    return;
+  }
   _menu = new KPopupMenu(this);
   //kstdDebug() << "Querying for the popup" << endl;
   bool rc = _view->popupMenu(_menu, e->pos());