]> Dogcows Code - chaz/openbox/blobdiff - src/main.cc
delete the openbox class, to shut things down properly!
[chaz/openbox] / src / main.cc
index e59749aa6cfc22184a7e05f975f3b3626d53241b..83cbf516103d5fbb5bfe195b76b34590e6665200 100644 (file)
@@ -36,11 +36,14 @@ int main(int argc, char **argv) {
   bind_textdomain_codeset(PACKAGE, "UTF-8");
   textdomain(PACKAGE);
 
-  ob::Openbox openbox(argc, argv);
-  openbox.eventLoop();
+  ob::Openbox *openbox = new ob::Openbox(argc, argv);
+  openbox->eventLoop();
 
-  if (openbox.doRestart()) {
-    const std::string &prog = openbox.restartProgram();
+  if (openbox->doRestart()) {
+    std::string prog = openbox->restartProgram();
+
+    delete openbox; // shutdown the current one!
+    
     if (!prog.empty()) {
       execl("/bin/sh", "/bin/sh", "-c", prog.c_str(), NULL); 
       perror(prog.c_str());
@@ -50,4 +53,6 @@ int main(int argc, char **argv) {
     execvp(argv[0], argv);
     execvp(otk::basename(argv[0]).c_str(), argv);
   }
+
+  delete openbox; // shutdown
 }
This page took 0.020966 seconds and 4 git commands to generate.