[fixed]getTextureMatrix() + ref count

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
piiichan
Posts: 59
Joined: Thu May 01, 2008 1:20 am
Location: New Caledonia (France - Pacific)
Contact:

[fixed]getTextureMatrix() + ref count

Post by piiichan »

If I call SMaterial::getTextureMatrix like this

Code: Select all

#include <irrlicht.h>

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#endif

int main() {
	IrrlichtDevice* device = createDevice(EDT_DIRECT3D9, dimension2d<s32>(640, 480));
	ISceneManager* smgr = device->getSceneManager();
	IVideoDriver* driver = device->getVideoDriver();

	ISceneNode* node = smgr->addCubeSceneNode();
	node->getMaterial(0).getTextureMatrix(0); // this line causes the program not to end correctly

	// main loop
	SColor backgroundColor(255,128,128,150);
	while( device->run() ) {
		driver->beginScene(true, true, backgroundColor);			
		smgr->drawAll();
		driver->endScene();
	}

	device->drop();
	
	return EXIT_SUCCESS;
}
I get the following message from VC++ when the program terminates
Windows has triggered a breakpoint in test_texture.exe.

This may be due to a corruption of the heap, and indicates a bug in test_texture.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information
with the debugger showing line 124 of IReferenceCounted.h

I'm using SVN trunk, rev 1406, VC++ 2005 SP1.

Very simple to reproduce. Could somebody please try it and see if the same thing happens?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Post Reply