Undefined behaviour in Mesher

Post Reply
Itusa
Hunter
Hunter
Posts: 85
Joined: Wed Jul 30, 2014 5:59 pm

Undefined behaviour in Mesher

Post by Itusa »

A warning, but one I'm trying to fix.

The code (Objconv/mesher/modules/convert.cpp:

Code: Select all

struct CRegistry {
		ConversionImplList list;

		CRegistry();

		~CRegistry()
		{
			for (ConversionImplList::iterator it=list.begin(); it!=list.end(); ++it)
			{
				delete it->second;
			}
			
			list.clear();
			
		}
	};
Yields the warning:

Code: Select all

deleting object of abstract class type ‘Converter::ConversionImpl’ which has non-virtual destructor will cause undefined behavior

delete it->second; //with the warning on second
At this rate, really all I want to do is just begin snipping the mehsher out because i'm pretty sure it doesn't work in the slightest but I'm not sure whether it's safe to do that so I'm trying to bring the code relatively up to date.

(This is present in the standard release).
Operating System: (Linux) Ubuntu 16.10 (Yakkety)
Vegastrike-taose: 0.5.1
Itusa
Hunter
Hunter
Posts: 85
Joined: Wed Jul 30, 2014 5:59 pm

Re: Undefined behaviour in Mesher

Post by Itusa »

Got it. Someone forgot a virtual keyword.
Operating System: (Linux) Ubuntu 16.10 (Yakkety)
Vegastrike-taose: 0.5.1
loki1950
The Shepherd
Posts: 5799
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Undefined behaviour in Mesher

Post by loki1950 »

There is another issue one of the deps is Ogre3D which has changed the it's API so no longer compiles.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Itusa
Hunter
Hunter
Posts: 85
Joined: Wed Jul 30, 2014 5:59 pm

Re: Undefined behaviour in Mesher

Post by Itusa »

Yeah I noticed when I had Ogre1.9 installed (had to remove), is that the entire Ogre3D because I can comment it out/remove from cmake like I did for FFMPEG?
Operating System: (Linux) Ubuntu 16.10 (Yakkety)
Vegastrike-taose: 0.5.1
loki1950
The Shepherd
Posts: 5799
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Undefined behaviour in Mesher

Post by loki1950 »

I would try that but IIRC then mesher just will not build as one of it's functions is the the conversion from our internal format to Ogre's .mesh have a look at the source you should be able to comment out that function or update the call for Ogre 3D to it's new API.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Itusa
Hunter
Hunter
Posts: 85
Joined: Wed Jul 30, 2014 5:59 pm

Re: Undefined behaviour in Mesher

Post by Itusa »

Back up a sec.

Why do we even use Ogre?

It would help if I were familiar with the filetypes concerned but it seems to me that there must be alternatives to "mesher" available or scrapping the idea of having native "files" in favour of things that are widely supported. So for example, if I wanted to add a ship, but only wanted to use the widely supported types such as .obj, would I be able to do that? If so, there's no *real* benefit to having mesher.

So far as I can tell... Vega Strike is the only software *ANYWHERE* that uses BFXM. Which is extremely bad for Open Source Software and discourages development.

The tutorial that I found was unclear and decidedly out of date, only indicating that the mesher doesn't work at any rate; http://vegastrike.sourceforge.net/wiki/HowTo:Add_Ships. Which is disappointing to say the least.
Operating System: (Linux) Ubuntu 16.10 (Yakkety)
Vegastrike-taose: 0.5.1
loki1950
The Shepherd
Posts: 5799
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Undefined behaviour in Mesher

Post by loki1950 »

We use Ogre 3D because there has been an effort to use it for our render pipeline that klauss started and he add the .mesh function.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Itusa
Hunter
Hunter
Posts: 85
Joined: Wed Jul 30, 2014 5:59 pm

Re: Undefined behaviour in Mesher

Post by Itusa »

Fair enough, but ships can be added without it?

Edit: I'm not planning on removing it, as 1. It's used (unlike ffmpeg), 2. Doesn't look that out of date (we'll see), 3. Pretty sure I'm more likely to get someone willing to maintain it.

Oh and edit:

Just in case I wasn't expressing my thanks (I wasn't), thanks for responding to my queries, I know that you don't have to considering that I'm not contributing to the "official" main (feel free to steal anything back). I can only hope to prove as useful to future potential developers.
Operating System: (Linux) Ubuntu 16.10 (Yakkety)
Vegastrike-taose: 0.5.1
loki1950
The Shepherd
Posts: 5799
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Undefined behaviour in Mesher

Post by loki1950 »

Heh we are Open Source :D friendly forks always welcome 8) and one of the reasons we are on GitHub now.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Post Reply