[fixed] Memory leak in CIrrDeviceStub.cpp

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Reiko
Posts: 105
Joined: Sun Aug 16, 2009 7:06 am
Location: Australia

[fixed] Memory leak in CIrrDeviceStub.cpp

Post by Reiko »

in CIrrDeviceStub.cpp

On line 41: (in the constructor)

Code: Select all

setRandomizer(createDefaultRandomizer());
createDefaultRandomizer() creates a randomizer and returns it.
setRandomizer() checks if the given randomizer is the same as the current one, and if not, drops the old one, and grabs the given one, making another copy. So you're making 2, and later (in the destructor) only deleting 1.

Instead of using the line above, it should be this.

Code: Select all

Randomizer = createDefaultRandomizer();
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Re: Memory leak in CIrrDeviceStub.cpp

Post by bitplane »

Fixed in trunk as of r3878, thanks for reporting :)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply