all repos — openbox @ f5904cdaaafa95e8ab6ffde212dfc6b7478b4e32

openbox fork - make it a bit more like ryudo

delete the openbox class, to shut things down properly!
Dana Jansens danakj@orodu.net
commit

f5904cdaaafa95e8ab6ffde212dfc6b7478b4e32

parent

478f240c7f6fa439322e8f0bf25a20ad343cd8f9

1 files changed, 9 insertions(+), 4 deletions(-)

jump to
M src/main.ccsrc/main.cc

@@ -36,11 +36,14 @@ bindtextdomain(PACKAGE, LOCALEDIR);

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()) { + std::string prog = openbox->restartProgram(); - if (openbox.doRestart()) { - const 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 @@ // fall back in case the above execlp doesn't work

execvp(argv[0], argv); execvp(otk::basename(argv[0]).c_str(), argv); } + + delete openbox; // shutdown }