summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Riedi <andrewriedi@gmail.com>2007-06-12 12:39:08 -0700
committerAndrew Riedi <andrewriedi@gmail.com>2007-06-12 12:39:08 -0700
commit439fa0756ea9b77021cd79706310244c35633880 (patch)
tree996a9bb82c2e4136850b20580e8143a5001ac7dd
parent1664bc208001020107e28ea84d8f90bfc9b3bb53 (diff)
downloadworkarounds-439fa0756ea9b77021cd79706310244c35633880.tar.gz
workarounds-439fa0756ea9b77021cd79706310244c35633880.tar.bz2
Fix crash on plug-in unload.
-rw-r--r--workarounds.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/workarounds.c b/workarounds.c
index 96fb071..9e0da16 100644
--- a/workarounds.c
+++ b/workarounds.c
@@ -41,6 +41,17 @@ static void workaroundsDisplayOptionChanged( CompDisplay *d, CompOption *opt,
static Bool workaroundsInitDisplay( CompPlugin *plugin, CompDisplay *d )
{
+ WorkaroundsDisplay *wd =
+ (WorkaroundsDisplay *) malloc( sizeof( WorkaroundsDisplay ) );
+
+ wd->screenPrivateIndex = allocateScreenPrivateIndex( d );
+ if ( wd->screenPrivateIndex < 0 )
+ {
+ free( wd );
+ return FALSE;
+ }
+ d->privates[displayPrivateIndex].ptr = wd;
+
workaroundsSetLegacyAppsNotify( d, workaroundsDisplayOptionChanged );
return TRUE;
@@ -48,6 +59,10 @@ static Bool workaroundsInitDisplay( CompPlugin *plugin, CompDisplay *d )
static void workaroundsFiniDisplay( CompPlugin *plugin, CompDisplay *d )
{
+ WORKAROUNDS_DISPLAY( d );
+
+ freeScreenPrivateIndex( d, wd->screenPrivateIndex );
+ free(wd);
}
static Bool workaroundsInitWindow( CompPlugin *plugin, CompWindow *w )