From b90c5c94a052a35de49065a79a4e324b26ff2207 Mon Sep 17 00:00:00 2001 From: jef Date: Fri, 24 Jul 2009 12:32:21 +0000 Subject: [PATCH] unload plugins before terminating after taking a snapshot git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11168 c8812cc2-4d05-0410-92ff-de0c093fc19c --- cmake/FindGRASS.cmake | 2 +- src/app/main.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/FindGRASS.cmake b/cmake/FindGRASS.cmake index 43c206441421..d74c951c0e43 100644 --- a/cmake/FindGRASS.cmake +++ b/cmake/FindGRASS.cmake @@ -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) diff --git a/src/app/main.cpp b/src/app/main.cpp index 9dacb65981fc..dd5038a92174 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -34,6 +34,8 @@ #include #include +#include "qgspluginregistry.h" + #include #include #include @@ -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(); @@ -704,6 +706,9 @@ int main( int argc, char *argv[] ) qgis->saveMapAsImage( mySnapshotFileName, myQPixmap ); myApp.processEvents(); qgis->hide(); + + QgsPluginRegistry::instance()->unloadAll(); + return 1; } @@ -717,5 +722,4 @@ int main( int argc, char *argv[] ) mypSplash->finish( qgis ); delete mypSplash; return myApp.exec(); - }