diff --git a/src/simImage.cc b/src/simImage.cc index ee75c73..a55fc87 100644 --- a/src/simImage.cc +++ b/src/simImage.cc @@ -25,6 +25,8 @@ simImage::simImage() blur = 0; pid = PID_NONE; lastWindow = 0; + // Task gets set to true when this simImage is connected to a currently open window + // and iff it is not a permanent starter task = false; } diff --git a/src/tasks.cc b/src/tasks.cc index 59dcb09..c875462 100644 --- a/src/tasks.cc +++ b/src/tasks.cc @@ -138,18 +138,18 @@ static void tasks_window_closed (WnckScreen *screen, WnckWindow *window,callback if (img->hasWindow(window)) { img->removeWindow(window); if (img->task && img->windowCount() == 0) { + // This can be safely deleted, it is not a starter and all windows are closed delete img; ImagesList->RemoveAt (i); } else if (img->windowCount() == 0) { - // we need to fall back to the default image, if a starter + // we need to fall back to the default image, as it is a permanent starter img->loadImage(img->img_link); - } - - if (img->windowCount() > 0) { + } else if (img->windowCount() > 0) { taskInfo ti; ti.Init(img->getWindow()); if (img->task) { - // starters still have their own image we prefer to use + // starters still have their own image we prefer to use, so we only do + // this for the non-starters img->img = ti.icon.ConvertToImage(); } }