Index: trunk/BNC/src/app.cpp
===================================================================
--- trunk/BNC/src/app.cpp	(revision 5083)
+++ trunk/BNC/src/app.cpp	(revision 5084)
@@ -20,13 +20,7 @@
 using namespace std;
 
-// Global Variable
-////////////////////////////////////////////////////////////////////////////
-t_bncCore* BNC_CORE = 0;
-
 // Constructor
 ////////////////////////////////////////////////////////////////////////////
-t_app::t_app(int& argc, char* argv[], bool GUIenabled) : 
-  QApplication(argc, argv, GUIenabled) {
-  BNC_CORE = new t_bncCore(GUIenabled);
+t_app::t_app(int& argc, char* argv[], bool GUIenabled) : QApplication(argc, argv, GUIenabled) {
 }
 
Index: trunk/BNC/src/bnccore.cpp
===================================================================
--- trunk/BNC/src/bnccore.cpp	(revision 5083)
+++ trunk/BNC/src/bnccore.cpp	(revision 5084)
@@ -56,8 +56,15 @@
 using namespace std;
 
+// Singleton 
+////////////////////////////////////////////////////////////////////////////
+t_bncCore& bncCoreInstance() {
+  static t_bncCore _bncCore;
+  return _bncCore;
+}
+
 // Constructor
 ////////////////////////////////////////////////////////////////////////////
-t_bncCore::t_bncCore(bool GUIenabled) {
-  _GUIenabled  = GUIenabled;
+t_bncCore::t_bncCore() {
+  _GUIenabled  = true;
   _logFileFlag = 0;
   _logFile     = 0;
Index: trunk/BNC/src/bnccore.h
===================================================================
--- trunk/BNC/src/bnccore.h	(revision 5083)
+++ trunk/BNC/src/bnccore.h	(revision 5084)
@@ -44,8 +44,9 @@
   public:
     enum e_mode {interactive, nonInteractive, batchPostProcessing};
-    t_bncCore(bool GUIenabled);
+    t_bncCore();
     virtual ~t_bncCore();  
     e_mode mode() const {return _mode;}
-    void   setMode(e_mode mode) {_mode = mode;}
+    void setGUIenabled(bool GUIenabled) {_GUIenabled = GUIenabled;}
+    void setMode(e_mode mode) {_mode = mode;}
     void setPort(int port);
     void setPortCorr(int port);
@@ -142,5 +143,7 @@
 };
 
-extern t_bncCore* BNC_CORE;
+t_bncCore& bncCoreInstance();
+
+#define BNC_CORE (&bncCoreInstance())
 
 #endif
Index: trunk/BNC/src/bncmain.cpp
===================================================================
--- trunk/BNC/src/bncmain.cpp	(revision 5083)
+++ trunk/BNC/src/bncmain.cpp	(revision 5084)
@@ -122,4 +122,6 @@
   app.setOrganizationName("BKG");
   app.setOrganizationDomain("www.bkg.bund.de");
+
+  BNC_CORE->setGUIenabled(GUIenabled);
   BNC_CORE->setConfFileName( confFileName );
 
Index: trunk/BNC/src/bncwindow.cpp
===================================================================
--- trunk/BNC/src/bncwindow.cpp	(revision 5083)
+++ trunk/BNC/src/bncwindow.cpp	(revision 5084)
@@ -74,5 +74,4 @@
 #ifdef GNSSCENTER_PLUGIN
 Q_EXPORT_PLUGIN2(gnsscenter_bnc, t_bncFactory)
-t_bncCore* BNC_CORE = 0;
 #endif
 
@@ -80,12 +79,4 @@
 ////////////////////////////////////////////////////////////////////////////
 bncWindow::bncWindow() {
-
-#ifdef GNSSCENTER_PLUGIN
-  if (BNC_CORE != 0) {
-    QMessageBox::critical(this, "Caution", "Only one BNC allowed");
-  }
-  BNC_CORE = new t_bncCore(true);
-  BNC_CORE->setConfFileName("");
-#endif
 
   _caster    = 0;
@@ -2045,9 +2036,4 @@
   }
 
-#ifdef GNSSCENTER_PLUGIN
-  delete BNC_CORE;
-  BNC_CORE = 0;
-#endif
-
   QMainWindow::closeEvent(event);
 }
