Hello, im working on a simple post processing shader. I can get the PP to work correctly until the resolution changes. Ive searched on the forum for how to restart the chain, some of which say just to resize the render target bmap. But ive only seen ptr_remove used to destroy the bmap, and bmap_createblack again. But if I do this, the texture memory gets used up, almost as if ptr_remove isnt removing anything. How do I restart this post processing without stacking memory?

the simple chain

Code:
BMAP* g_buffer_scene;

VIEW* camMix = { layer = 2; }


function start_PP ()
{
	
	
g_buffer_scene = bmap_createblack(screen_size.x, screen_size.y, 24);  //screen_size.x, screen_size.y

camera->bmap = g_buffer_scene;

//	VIEW *camMix = view_create ( 2 );

   camMix->material = post_blood_pixel;	//pp_test_mine;	

	camMix->flags |= PROCESS_TARGET | SHOW;
	

camera->stage = camMix;
	
}



The attempt to remove the chain and free memory:
Code:
bmap_purge(g_buffer_scene);
   ptr_remove(g_buffer_scene);
   
   ptr_remove(camMix->material);
	ptr_remove(camMix->bmap);
	ptr_remove(camMix);



But memory isnt freed when I try to remove the chain. I want to remove it first, then i can attempt to restart it.

I just want to reapply the PP after the resolution changes.