On Wed, Jun 24, 2009 at 6:50 PM, Alan W. Irwin<ir...@beluga.phys.uvic.ca> wrote: > * The "QMutex destructor called twice" issue that Dmitri discovered. This > shows up as lots of valgrind output involving PLplot code and a hang (which > you can get out of with ctrl-C) when you attempt to exit the qt_example GUI.
After thinking and debugging a bit, I found out: * if you compile with ENABLE_DYNDRIVERS=OFF, the problem doesn't show up * with ENABLE_DYNDRIVERS=ON qt_example doesn't compile, the linker cannot find methods from QtExtWidget as well as plsetqtdev()/plfreeqtdev(). After I add -lplplotqtd to the line 88 of examples/c++/Makefile.examples.in, qt_example compiles fine. Am I doing anything wrong? Now at startup qt_example loads libplplotqtd.so, which contains all code from qt.cpp, including the code that is supposed to be loaded dynamically. At some point it calls plinit(), that calls plLoadDriver(), that loads qt.so -- in fact, the second copy of the code! Of course, at shutdown of the application destructors are get called from each library, but they touch the same global data. In this light, my proposed solution is just a hack. For a proper solution, I think it is needed to split qt.cpp in two parts: * libplpllotqtd.so should contain only classes and functions user needs to see (plsetqtdev()/plfreeqtdev()); * qt.so should contain only functions that are callbacks for plplot core. qt.so will need to be linked against libplplotqtd.so. Dmitri -- main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if (j){printf("%d\n",i);}}} /*Dmitri Gribenko <griboz...@gmail.com>*/ ------------------------------------------------------------------------------ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel