]> Dogcows Code - chaz/openbox/commitdiff
fix 2 bus errors on osx:
authorDana Jansens <danakj@orodu.net>
Thu, 18 Apr 2002 20:56:23 +0000 (20:56 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 18 Apr 2002 20:56:23 +0000 (20:56 +0000)
 - it's std::string doesnt like being set to NULL.
 - in Window.cc, caught someone using a membr variable after calling 'delete this'. bad.

src/Screen.cc
src/Window.cc

index 313aeb21e8efa2c9a053832334f2d47298b50759..4f4718ec1a4eab95b4f57cd2f4ca55d525cf61f3 100644 (file)
@@ -1402,8 +1402,13 @@ void BScreen::removeWorkspaceNames(void) {
 void BScreen::LoadStyle(void) {
   Resource &conf = resource.styleconfig;
   
-  conf.setFile(openbox.getStyleFilename());
-  if (!conf.load()) {
+  const char *sfile = openbox.getStyleFilename();
+  bool loaded = false;
+  if (sfile != NULL) {
+    conf.setFile(sfile);
+    loaded = conf.load();
+  }
+  if (!loaded) {
     conf.setFile(DEFAULTSTYLE);
     if (!conf.load()) {
       fprintf(stderr, i18n->getMessage(ScreenSet, ScreenDefaultStyleLoadFail,
index c2e8644b9c7b8d5b6a327bc0ea7951d4d99e4b40..56487e0bd99c2674394bdae38f26993810b4d86a 100644 (file)
@@ -168,9 +168,8 @@ OpenboxWindow::OpenboxWindow(Openbox &o, Window w, BScreen *s) : openbox(o) {
 #ifdef    SLIT
   if (client.initial_state == WithdrawnState) {
     screen->getSlit()->addClient(client.window);
-    delete this;
-
     openbox.ungrab();
+    delete this;
     return;
   }
 #endif // SLIT
This page took 0.025633 seconds and 4 git commands to generate.