diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-09-28 11:05:44 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-09-28 11:05:44 -0230 |
commit | 7d20430028f05cc26c412465176a75ce4ea5af9e (patch) | |
tree | 593695acf366f7e3a7081d15af8f474683ce4af7 /cpp/src/IceGrid/IceGridNode.cpp | |
parent | Removed unused __checkTwoway(const char*) from Proxy (diff) | |
download | ice-7d20430028f05cc26c412465176a75ce4ea5af9e.tar.bz2 ice-7d20430028f05cc26c412465176a75ce4ea5af9e.tar.xz ice-7d20430028f05cc26c412465176a75ce4ea5af9e.zip |
Bug 3231 - alternative storage for IceGrid and IceStorm
Diffstat (limited to 'cpp/src/IceGrid/IceGridNode.cpp')
-rw-r--r-- | cpp/src/IceGrid/IceGridNode.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index a63c8e13a05..245f8a88ba0 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -29,6 +29,11 @@ #endif #include <IceGrid/DescriptorParser.h> #include <IcePatch2/Util.h> +#ifdef QTSQL +# include <IceSQL/SqlTypes.h> +# include <QtCore/QCoreApplication> +# include <QtCore/QTextCodec> +#endif #ifdef _WIN32 # include <direct.h> @@ -71,6 +76,7 @@ class NodeService : public Service public: NodeService(); + ~NodeService(); virtual bool shutdown(); @@ -92,6 +98,9 @@ private: NodeIPtr _node; NodeSessionManager _sessions; Ice::ObjectAdapterPtr _adapter; +#ifdef QTSQL + QCoreApplication* _qtApp; +#endif }; class CollocatedRegistry : public RegistryI @@ -173,6 +182,18 @@ NodeService::NodeService() { } +NodeService::~NodeService() +{ +#ifdef QTSQL + if(_qtApp != 0) + { + delete _qtApp; + _qtApp = 0; + } +#endif +} + + bool NodeService::shutdown() { @@ -803,6 +824,15 @@ NodeService::initializeCommunicator(int& argc, char* argv[], // initData.properties->setProperty("Ice.Admin.DelayCreation", "1"); +#ifdef QTSQL + if(QCoreApplication::instance() == 0) + { + _qtApp = new QCoreApplication(argc, argv); + QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); + } + initData.threadHook = new IceSQL::ThreadHook(); +#endif + return Service::initializeCommunicator(argc, argv, initData); } |