On Mon, 28 Mar 2011 10:56:08 -0400, Adam Jackson <[email protected]> wrote:
> No code to create objects of this type ever existed.
I suspect that's a bug then -- the damage object is going to hang around
with a dead pointer to the window when it is destroyed.
Here's a completely untested patch that hooks the window id to the
damage record so that it is destroyed when the window is destroyed:
I think this gets the ENOMEM case right -- AddResource will call
FreeDamageExtWin if it fails, which will call FreeResource on the damage
ID, freeing the damage structure.
diff --git a/damageext/damageext.c b/damageext/damageext.c
index 754383d..20f772b 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -220,8 +220,10 @@ ProcDamageCreate (ClientPtr client)
DamageSetReportAfterOp (pDamageExt->pDamage, TRUE);
DamageRegister (pDamageExt->pDrawable, pDamageExt->pDamage);
- if (pDrawable->type == DRAWABLE_WINDOW)
+ if (WindowDrawable(pDrawable->type))
{
+ if (!AddResource (pDrawable->id, DamageExtWinType, (pointer)
pDamageExt))
+ return BadAlloc;
pRegion = &((WindowPtr) pDrawable)->borderClip;
DamageDamageRegion(pDrawable, pRegion);
}
--
[email protected]
pgpQ3pNhXzKtv.pgp
Description: PGP signature
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
