Navigation Menu

Skip to content

Commit

Permalink
unload plugins before terminating after taking a snapshot
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11168 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jul 24, 2009
1 parent 8d6fed8 commit b90c5c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmake/FindGRASS.cmake
Expand Up @@ -11,7 +11,7 @@ MACRO (CHECK_GRASS G_PREFIX)

FOREACH (LIB ${GRASS_LIB_NAMES})
SET(LIB_PATH NOTFOUND)
FIND_LIBRARY(LIB_PATH grass_${LIB} PATHS ${G_PREFIX}/lib)
FIND_LIBRARY(LIB_PATH NAMES grass_${LIB} PATHS ${G_PREFIX}/lib NO_DEFAULT_PATH)

IF (LIB_PATH)
IF (NOT GRASS_LIBRARIES STREQUAL NOTFOUND)
Expand Down
8 changes: 6 additions & 2 deletions src/app/main.cpp
Expand Up @@ -34,6 +34,8 @@
#include <QTranslator>
#include <QImageReader>

#include "qgspluginregistry.h"

#include <cstdio>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -694,7 +696,7 @@ int main( int argc, char *argv[] )
It looks like you don't run the event loop in non-interactive mode, so the
event is never occuring.
To achieve this without runing the event loop: show the window, then call
To achieve this without running the event loop: show the window, then call
qApp->processEvents(), grab the pixmap, save it, hide the window and exit.
*/
//qgis->show();
Expand All @@ -704,6 +706,9 @@ int main( int argc, char *argv[] )
qgis->saveMapAsImage( mySnapshotFileName, myQPixmap );
myApp.processEvents();
qgis->hide();

QgsPluginRegistry::instance()->unloadAll();

return 1;
}

Expand All @@ -717,5 +722,4 @@ int main( int argc, char *argv[] )
mypSplash->finish( qgis );
delete mypSplash;
return myApp.exec();

}

0 comments on commit b90c5c9

Please sign in to comment.