dix: Fixes a memory leak when a cursor resource is released.
Just open and close a client that creates cursors in order to reproduce. In the problem case bits->refcnt is -1 and therefore bits->devPrivates is never released. Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
412c56ef33
commit
0573042cdd
|
@ -86,6 +86,8 @@ FreeCursorBits(CursorBitsPtr bits)
|
||||||
#ifdef ARGB_CURSOR
|
#ifdef ARGB_CURSOR
|
||||||
xfree(bits->argb);
|
xfree(bits->argb);
|
||||||
#endif
|
#endif
|
||||||
|
dixFreePrivates(bits->devPrivates);
|
||||||
|
bits->devPrivates = NULL;
|
||||||
if (bits->refcnt == 0)
|
if (bits->refcnt == 0)
|
||||||
{
|
{
|
||||||
GlyphSharePtr *prev, this;
|
GlyphSharePtr *prev, this;
|
||||||
|
@ -100,7 +102,6 @@ FreeCursorBits(CursorBitsPtr bits)
|
||||||
CloseFont(this->font, (Font)0);
|
CloseFont(this->font, (Font)0);
|
||||||
xfree(this);
|
xfree(this);
|
||||||
}
|
}
|
||||||
dixFreePrivates(bits->devPrivates);
|
|
||||||
xfree(bits);
|
xfree(bits);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue