static void
wizardDonePaintScreen (CompScreen *s)
{
    WIZARD_SCREEN (s);
    WIZARD_DISPLAY (s->display);

    if (ws->active || (ws->ps && ws->ps->active))
	damageRegion (s);

    if (!ws->active && ws->pollHandle)
    {
	(*wd->mpFunc->removePositionPolling) (s, ws->pollHandle);
	ws->pollHandle = 0;
    }

    if (!ws->active && ws->ps && !ws->ps->active)
    {
	finiParticles (ws->ps);
	free (ws->ps);
	ws->ps = NULL;
    }

    UNWRAP (ws, s, donePaintScreen);
    (*s->donePaintScreen) (s);
    WRAP (ws, s, donePaintScreen, wizardDonePaintScreen);
}
void
particlesCleanup (CompWindow * w)
{
    ANIMADDON_WINDOW (w);

    if (aw->eng.numPs)
    {
	int i = 0;

	for (i = 0; i < aw->eng.numPs; i++)
	    finiParticles (aw->eng.ps + i);
	free (aw->eng.ps);
	aw->eng.ps = NULL;
	aw->eng.numPs = 0;
    }
}
ParticleSystem::~ParticleSystem ()
{
    finiParticles ();
}