devPrivates rework: properly free devPrivates on compatibility structures,
type pixmap. Requires ddx'es to call the free function from DestroyPixmap.
This commit is contained in:
parent
1d550bb2c5
commit
5ad562565a
|
@ -55,6 +55,7 @@ SOFTWARE.
|
||||||
#include "gc.h"
|
#include "gc.h"
|
||||||
#include "colormap.h"
|
#include "colormap.h"
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
|
#include "privates.h"
|
||||||
#include "mibstore.h"
|
#include "mibstore.h"
|
||||||
#include "mfb.h"
|
#include "mfb.h"
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,7 @@ afbDestroyPixmap(pPixmap)
|
||||||
{
|
{
|
||||||
if(--pPixmap->refcnt)
|
if(--pPixmap->refcnt)
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
dixFreePrivates(*DEVPRIV_PTR(pPixmap));
|
||||||
xfree(pPixmap);
|
xfree(pPixmap);
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include "colormap.h"
|
#include "colormap.h"
|
||||||
#include "miscstruct.h"
|
#include "miscstruct.h"
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
|
#include "privates.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "mfb.h"
|
#include "mfb.h"
|
||||||
#undef PixelType
|
#undef PixelType
|
||||||
|
|
|
@ -107,6 +107,7 @@ cfbDestroyPixmap(pPixmap)
|
||||||
{
|
{
|
||||||
if(--pPixmap->refcnt)
|
if(--pPixmap->refcnt)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
dixFreePrivates(*DEVPRIV_PTR(pPixmap));
|
||||||
xfree(pPixmap);
|
xfree(pPixmap);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
1
fb/fb.h
1
fb/fb.h
|
@ -38,6 +38,7 @@
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
#include "migc.h"
|
#include "migc.h"
|
||||||
#include "mibstore.h"
|
#include "mibstore.h"
|
||||||
|
#include "privates.h"
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
#include "picturestr.h"
|
#include "picturestr.h"
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -98,6 +98,7 @@ fbDestroyPixmap (PixmapPtr pPixmap)
|
||||||
{
|
{
|
||||||
if(--pPixmap->refcnt)
|
if(--pPixmap->refcnt)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
dixFreePrivates(*DEVPRIV_PTR(pPixmap));
|
||||||
xfree(pPixmap);
|
xfree(pPixmap);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
|
|
||||||
#include "pixmapstr.h"
|
#include "pixmapstr.h"
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
|
#include "privates.h"
|
||||||
|
|
||||||
/** Initialize a private area in \a pScreen for pixmap information. */
|
/** Initialize a private area in \a pScreen for pixmap information. */
|
||||||
Bool dmxInitPixmap(ScreenPtr pScreen)
|
Bool dmxInitPixmap(ScreenPtr pScreen)
|
||||||
|
@ -173,6 +174,7 @@ Bool dmxDestroyPixmap(PixmapPtr pPixmap)
|
||||||
dmxSync(dmxScreen, FALSE);
|
dmxSync(dmxScreen, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dixFreePrivates(*DEVPRIV_PTR(pPixmap));
|
||||||
xfree(pPixmap);
|
xfree(pPixmap);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -310,6 +310,7 @@ xglDestroyPixmap (PixmapPtr pPixmap)
|
||||||
|
|
||||||
xglFiniPixmap (pPixmap);
|
xglFiniPixmap (pPixmap);
|
||||||
|
|
||||||
|
dixFreePrivates(*DEVPRIV_PTR(pPixmap));
|
||||||
xfree (pPixmap);
|
xfree (pPixmap);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -24,6 +24,7 @@ is" without express or implied warranty.
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
#include "gc.h"
|
#include "gc.h"
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
|
#include "privates.h"
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
|
|
||||||
#include "Xnest.h"
|
#include "Xnest.h"
|
||||||
|
@ -74,6 +75,7 @@ xnestDestroyPixmap(PixmapPtr pPixmap)
|
||||||
if(--pPixmap->refcnt)
|
if(--pPixmap->refcnt)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
XFreePixmap(xnestDisplay, xnestPixmap(pPixmap));
|
XFreePixmap(xnestDisplay, xnestPixmap(pPixmap));
|
||||||
|
dixFreePrivates(*DEVPRIV_PTR(pPixmap));
|
||||||
xfree(pPixmap);
|
xfree(pPixmap);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,7 @@ in this Software without prior written authorization from The Open Group.
|
||||||
|
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "gcstruct.h"
|
#include "gcstruct.h"
|
||||||
|
#include "privates.h"
|
||||||
|
|
||||||
#include "Ps.h"
|
#include "Ps.h"
|
||||||
|
|
||||||
|
@ -111,9 +112,13 @@ PsCreatePixmap(
|
||||||
pPixmap->devKind = 0;
|
pPixmap->devKind = 0;
|
||||||
pPixmap->refcnt = 1;
|
pPixmap->refcnt = 1;
|
||||||
|
|
||||||
|
pPixmap->devPrivates = (DevUnion *)xcalloc(1, sizeof(DevUnion));
|
||||||
|
if( !pPixmap->devPrivates )
|
||||||
|
{ xfree(pPixmap); return NullPixmap; }
|
||||||
|
|
||||||
pPixmap->devPrivate.ptr = (PsPixmapPrivPtr)xcalloc(1, sizeof(PsPixmapPrivRec));
|
pPixmap->devPrivate.ptr = (PsPixmapPrivPtr)xcalloc(1, sizeof(PsPixmapPrivRec));
|
||||||
if( !pPixmap->devPrivate.ptr )
|
if( !pPixmap->devPrivate.ptr )
|
||||||
{ xfree(pPixmap); return NullPixmap; }
|
{ xfree(pPixmap->devPrivates); xfree(pPixmap); return NullPixmap; }
|
||||||
return pPixmap;
|
return pPixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,6 +201,7 @@ PsDestroyPixmap(PixmapPtr pPixmap)
|
||||||
PsScrubPixmap(pPixmap);
|
PsScrubPixmap(pPixmap);
|
||||||
|
|
||||||
xfree(priv);
|
xfree(priv);
|
||||||
|
dixFreePrivates(*DEVPRIV_PTR(pPixmap));
|
||||||
xfree(pPixmap);
|
xfree(pPixmap);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,7 @@ SOFTWARE.
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
#include "gc.h"
|
#include "gc.h"
|
||||||
#include "colormap.h"
|
#include "colormap.h"
|
||||||
|
#include "privates.h"
|
||||||
#include "miscstruct.h"
|
#include "miscstruct.h"
|
||||||
#include "mibstore.h"
|
#include "mibstore.h"
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,7 @@ mfbDestroyPixmap(pPixmap)
|
||||||
{
|
{
|
||||||
if(--pPixmap->refcnt)
|
if(--pPixmap->refcnt)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
dixFreePrivates(*DEVPRIV_PTR(pPixmap));
|
||||||
xfree(pPixmap);
|
xfree(pPixmap);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user