summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2007-12-09 17:06:11 +0100
committerKristian Lyngstol <kristian@windu.lyngstol.net>2007-12-09 17:06:11 +0100
commita9b9684cb6b71845500dbb14c6289f2aeee2aab5 (patch)
tree95e3e6ef16cf6a8b2c8e16f2f32841a3bb0a2752
parent3ba9b9a7d31b0b486c824cc5e8394ae2e22efe15 (diff)
downloadshelf-a9b9684cb6b71845500dbb14c6289f2aeee2aab5.tar.gz
shelf-a9b9684cb6b71845500dbb14c6289f2aeee2aab5.tar.bz2
Add *Fini functions to clean up (no longer crash on unload)
-rw-r--r--shelf.c48
1 files changed, 44 insertions, 4 deletions
diff --git a/shelf.c b/shelf.c
index ca7912f..42da8e2 100644
--- a/shelf.c
+++ b/shelf.c
@@ -135,6 +135,19 @@ mwPaintWindow (CompWindow *w,
}
/* Configuration, initialization, boring stuff. --------------------- */
+static void
+miniwin2FiniScreen (CompPlugin *p,
+ CompScreen *s)
+{
+ MINI_SCREEN (s);
+ if (!ms)
+ return ;
+ UNWRAP (ms, s, paintWindow);
+ UNWRAP (ms, s, damageWindowRect);
+ if (ms->windowPrivateIndex)
+ freeWindowPrivateIndex (s, ms->windowPrivateIndex);
+ free (ms);
+}
static Bool
miniwin2InitScreen (CompPlugin *p,
CompScreen *s)
@@ -150,6 +163,14 @@ miniwin2InitScreen (CompPlugin *p,
return TRUE;
}
+static void
+miniwin2FiniDisplay (CompPlugin *p,
+ CompDisplay *d)
+{
+ if (screenPrivateIndex >= 0)
+ freeScreenPrivateIndex (d, screenPrivateIndex);
+}
+
static Bool
miniwin2InitDisplay (CompPlugin *p,
CompDisplay *d)
@@ -163,6 +184,14 @@ miniwin2InitDisplay (CompPlugin *p,
return TRUE;
}
+static void
+miniwin2Fini (CompPlugin *p)
+{
+ if (displayPrivateIndex >= 0)
+ freeDisplayPrivateIndex (displayPrivateIndex);
+ return ;
+}
+
static Bool
miniwin2Init (CompPlugin *p)
{
@@ -172,6 +201,17 @@ miniwin2Init (CompPlugin *p)
return TRUE;
}
+static void
+miniwin2FiniWindow (CompPlugin *p,
+ CompWindow *w)
+{
+ MINI_SCREEN (w->screen);
+ MINI_WINDOW (w);
+ if (mw)
+ free (mw);
+ return;
+}
+
static Bool
miniwin2InitWindow (CompPlugin *p,
CompWindow *w)
@@ -208,10 +248,10 @@ miniwin2FiniObject (CompPlugin *p,
CompObject *o)
{
static FiniPluginObjectProc dispTab[] = {
- (FiniPluginObjectProc) 0, /* FiniCore */
- 0,
- 0,
- 0
+ (FiniPluginObjectProc) miniwin2Fini, /* InitCore */
+ (FiniPluginObjectProc) miniwin2FiniDisplay,
+ (FiniPluginObjectProc) miniwin2FiniScreen,
+ (FiniPluginObjectProc) miniwin2FiniWindow
};
DISPATCH (o, dispTab, ARRAY_SIZE (dispTab), (p, o));