Steps to reproduce:

In the arranger, have at least two Audio Tracks.
They must be tracks for which clicking on the mixer strip's in or out 
 routing buttons does in fact pop up a menu of some kind i.e. they are   
 routeable to each other.
  
Select one of the tracks. Click on either the 'out routes' or 'in routes' 
 button on the Arranger mixer strip.

The Routing popup menu should appear.

While the menu is open, click on /another/ track in the Arranger.

MusE will then crash with a segfault.


It happens because:
void AudioStrip::oRoutePressed()
{
      RoutePopupMenu* pup = new RoutePopupMenu();
      pup->exec(QCursor::pos(), track, true);
      delete pup;
      oR->setDown(false);     // <<<<< Crash here, oR is zero <<<<<<<
}

While that popup menu is open and you switch to another track:

void Arranger::switchInfo(int n)
      {
      if (n == 2) {
            AudioStrip* w = (AudioStrip*)(trackInfo->getWidget(2));
            if (w == 0 || selected != w->getTrack()) {
                  if (w)
                        delete w;    //    <<<<<<  It gets here <<<<<<<
                  w = new AudioStrip(trackInfo, 
                                                
(MusECore::AudioTrack*)selected);
.....
}

I found that when you click on another track, switchInfo() is unfortunately 
 being called /before/ the routing popup menu is told to close by Qt.
(Why does that seem strange, that the menu is not told to close first?)

Thus as you can be my comments above, the result is effectively like having a:
      delete this; 
 after the above
      pup->exec(QCursor::pos(), track, true);
 so it crashes st the indicated location above.

Weird, how do I get Qt to close the menu, /before/ it executes code
 resulting from clicking /away/ from the menu?

Cheers.
Tim.

PS: Working on GUI stuff, hope to have something very interesting soon.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Lmuse-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmuse-developer

Reply via email to