[2.x] Issue with CompositorPassProvider causing Heap Corruptions

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

[2.x] Issue with CompositorPassProvider causing Heap Corruptions

Post by al2950 »

Ok the title might not be fair, but I just spent an hour hunting down a heap corruption.

This issue is caused by the fact the CompositorPassProvider asks dev code to instantiate a passDef or pass, but Ogre deletes it. So if a dev uses new or there own allocator instead of OGRE_NEW, bad stuff will happen, mainly because ogre's default allocator use delete [], for everything.

Would it be sensible to add a couple of destroy* methods to the interface to stop others running into this issue? (No one wants to be dealing with a heap corruption first thing Monday morning!)
Post Reply