summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@compiz-fusion.org>2009-08-27 18:36:40 +0200
committerDennis kasprzyk <onestone@compiz-fusion.org>2009-08-27 18:36:40 +0200
commit379b43fe0ab2665c942ffa2d14fc4228f533401c (patch)
tree98b883d9e175ef4a31505795bd3a1b570158c92a
parenta6ae8e25a17e408dcbe8b31f42754c06b83d23c3 (diff)
downloadbcop-379b43fe0ab2665c942ffa2d14fc4228f533401c.tar.gz
bcop-379b43fe0ab2665c942ffa2d14fc4228f533401c.tar.bz2
Don't return Options if Screen/Display has been freed.
-rw-r--r--src/bcop.xslt17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bcop.xslt b/src/bcop.xslt
index 8f169d6..6976df2 100644
--- a/src/bcop.xslt
+++ b/src/bcop.xslt
@@ -723,6 +723,11 @@ void </xsl:text>
</xsl:text>
<xsl:value-of select="$PLUGIN"/>
<xsl:text>_OPTIONS_DISPLAY(d);
+ if (!od)
+ {
+ *count = 0;
+ return NULL;
+ }
*count = </xsl:text>
<xsl:value-of select="$Plugin"/>
<xsl:text>DisplayOptionNum;
@@ -740,6 +745,11 @@ void </xsl:text>
</xsl:text>
<xsl:value-of select="$PLUGIN"/>
<xsl:text>_OPTIONS_SCREEN(s);
+ if (!os)
+ {
+ *count = 0;
+ return NULL;
+ }
*count = </xsl:text>
<xsl:value-of select="$Plugin"/>
<xsl:text>ScreenOptionNum;
@@ -955,6 +965,9 @@ static void </xsl:text>
</xsl:text>
<xsl:value-of select="$PLUGIN"/>
<xsl:text>_OPTIONS_SCREEN (s);
+ </xsl:text>
+ <xsl:value-of select="$PLUGIN"/>
+ <xsl:text>_OPTIONS_DISPLAY (s->display);
</xsl:text>
<xsl:if test="/compiz/plugin[@name=$pName]/screen/descendant-or-self::option">
@@ -966,6 +979,7 @@ static void </xsl:text>
</xsl:text>
</xsl:if>
<xsl:text> free (os);
+ s->base.privates[od->screenPrivateIndex].ptr = NULL;
}
</xsl:text>
@@ -1067,6 +1081,9 @@ static void </xsl:text>
</xsl:text>
</xsl:if>
<xsl:text> free (od);
+ d->base.privates[</xsl:text>
+ <xsl:value-of select="$Plugin"/>
+ <xsl:text>OptionsDisplayPrivateIndex].ptr = NULL;
}
</xsl:text>