IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Post by Zurzaza »

I found and resolved a leak into "CIrrOdeGeomTrimesh.cpp", by adding

Code: Select all

  for(u32 i=0;i < m_aParams.size();i++)
  {
	  delete m_aParams[i];
  }
in the destructor.

It also seems that ODE make a call to a reserved memory:

Code: Select all

first-chance exception at 0x75e4c113 in Engine.exe: 0xC0000005: Access violation when reading 0xcccccccc.
every time step() function is called.
Brainsaw
Posts: 1177
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Thanks. I added this to the SVN, but I need to do some more stuff, e.g. remove the objects from the global list in the IrrOde manager.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Post by Zurzaza »

Ok, i fixed another leak in CIrrOdeManager that occurs if you don't call closeODE() function, so I added the call into the destructor:

CIrrOdeManager.cpp

Code: Select all

CIrrOdeManager::~CIrrOdeManager() {
	
	this->getIrrOdeNodes().clear();

	if(this->physicsInitialized() == true)
		this->closeODE();

	delete m_pOdeDevice;
	
}
Now, it seems there are other bugs into initPhysics() function, but i cannot get rid from they.. :@
I also noticed that there are some nodes that aren't deleted from the scene...but I don't understand why...
Brainsaw
Posts: 1177
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Thanks again, added your code to the SVN, although the destructor of the IrrOdeManager should only be called at the very end of the program as it's a singleton.

I think I'll have to do some cleanup. There are way to many lists in the manager. I'll check out every one of the within the next days and see which are needed and which are not.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Post by Zurzaza »

Brainsaw wrote:the destructor of the IrrOdeManager should only be called at the very end of the program as it's a singleton.
I think that the destructor will be called automatically at the end of the program, if you don't call him before ;)
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Zurzaza wrote:
Brainsaw wrote:the destructor of the IrrOdeManager should only be called at the very end of the program as it's a singleton.
I think that the destructor will be called automatically at the end of the program, if you don't call him before ;)
If you delete an object, is destructor called than too? :oops:
Working on game: Marrbles (Currently stopped).
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

serengeor wrote:
Zurzaza wrote:
Brainsaw wrote:the destructor of the IrrOdeManager should only be called at the very end of the program as it's a singleton.
I think that the destructor will be called automatically at the end of the program, if you don't call him before ;)
If you delete an object, is destructor called than too? :oops:
Yes.

There are two ways how you can use object, and destructor automatically called in both of them:

#1:

Code: Select all

...
{
    MyObject m;
    m.MyMemer = ...
    ...
} // here destructor auto-call
...
#2:

Code: Select all

...
{
    MyObject* m = new MyObject();
    m->MyMemer = ...
    ...
    delete m; // here destructor auto-call
} 
...
P.S.: same for constructors. That is the main purpose of its invention.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Is there a reason why it would crash on destructor call (it contains some deletion code) if I called it myself, tough it doesn't crash if I put deletion code into a function?
Working on game: Marrbles (Currently stopped).
booe
Posts: 76
Joined: Thu Jul 29, 2010 2:12 pm

Post by booe »

serengeor wrote:
Zurzaza wrote:
Brainsaw wrote:the destructor of the IrrOdeManager should only be called at the very end of the program as it's a singleton.
I think that the destructor will be called automatically at the end of the program, if you don't call him before ;)
If you delete an object, is destructor called than too? :oops:
Image
lol, first learn the basics of the basics of C++ basic and THEN eventually post HERE! This forum is not an interactive C++ tutorial! So SOD OFF!!

And change your avatar - its annoying.


btw: Brainsaw, is it possible to implement forcefields (like in nvidia physx) in irrOde? You'll have to get all objects in given area and apply forces to them every frame... ever tought about implementation of such feature?
Last edited by booe on Fri Jul 30, 2010 8:37 pm, edited 1 time in total.
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Post by Zurzaza »

serengeor wrote:Is there a reason why it would crash on destructor call (it contains some deletion code) if I called it myself, tough it doesn't crash if I put deletion code into a function?
Depends on what you've put in your destructor...maybe you're deleting some pointers that are in use yet, so you'll have a segmentation fault.
and....please, if you've got other c++ basic questions, do not post here. thanks ;)
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Ok, sorry :oops:
Working on game: Marrbles (Currently stopped).
ArakisTheKitsune
Posts: 73
Joined: Sat Jun 27, 2009 6:52 am

Post by ArakisTheKitsune »

booe wrote:
serengeor wrote:
Zurzaza wrote: I think that the destructor will be called automatically at the end of the program, if you don't call him before ;)
If you delete an object, is destructor called than too? :oops:
lol, first learn the basics of the basics of C++ basic and THEN eventually post HERE! This forum is not an interactive C++ tutorial! So SOD OFF!!

And change your avatar - its annoying.
I saw like 1000 basic c++ questions here on forum. Maybe you want to tell them too to buzz off? Every one have to start from something, you can't blame anyone for asking such question. And I like your "change your avatar" line it's so nazi. You know what happeand to nazi on forum? They got eaten by the grue.
Knowledge is power, understanding is wisdom.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Well maybe he hates windows, for some unknown reason (doesn't know how to use them properly), i understand and i will change my avatar as soon as i can (NOT).

Again sorry for offtopic talks ;]

Oh and good wrapper does it leak how much does it use memory when its just initialized ?
Working on game: Marrbles (Currently stopped).
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Post by Zurzaza »

serengeor wrote:Oh and good wrapper does it leak how much does it use memory when its just initialized ?
I think I didn't understand properly what are you asking...Are you asking for when this wrapper leaks...right?
It will make a leak every time you initialize a node, and when you call initPhysics() function ;)
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

well I didn't asked for a leaks, let me try to rephrase the question
How much memory does the wrapper use when initialized (the main physics class) without any collision bodies, and how much does it use for example 1 cube.
Working on game: Marrbles (Currently stopped).
Post Reply