Page 1 of 1

Problem with running Warzone compiled in VS2010

Posted: 06 Dec 2012, 17:21
by Reg312
Hello
I'm using VS2010 for compiling warzone for my debug experiments
Source file stats.cpp was changes in latest commints in master-version (converting stats to ini)
since this changes i cannot run warzone, getting memory errors!

Also i found way to fix this memory erros
i just need add strdup() calls to places where QT string get converted to c-string
e.g.
weaponName =ini.value("turret").toString().toUtf8().constData();
weaponName = strdup(ini.value("turret").toString().toUtf8().constData());

after this changes i can run warzone.

Also i got problem with nonexistent file e3demo.cpp (just removed it from list of files and warzone got compiled)

Re: Problem with running Warzone compiled in VS2010

Posted: 06 Dec 2012, 17:43
by aubergine
The E3 demo was removed recently according to this: viewtopic.php?f=3&t=10252

Re: Problem with running Warzone compiled in VS2010

Posted: 06 Dec 2012, 17:49
by Per
Reg312 wrote:i just need add strdup() calls to places where QT string get converted to c-string
e.g.
weaponName =ini.value("turret").toString().toUtf8().constData();
weaponName = strdup(ini.value("turret").toString().toUtf8().constData());
Please file a bug ticket.

Re: Problem with running Warzone compiled in VS2010

Posted: 06 Dec 2012, 18:07
by Reg312
Per wrote:
Reg312 wrote:i just need add strdup() calls to places where QT string get converted to c-string
e.g.
weaponName =ini.value("turret").toString().toUtf8().constData();
weaponName = strdup(ini.value("turret").toString().toUtf8().constData());
Please file a bug ticket.

if i understood correct - here is ticket #3821

Re: Problem with running Warzone compiled in VS2010

Posted: 07 Dec 2012, 04:27
by vexed
"FEFEFEFE"

This is *not* a problem with VS2010.
This is a problem with that commit, and also a problem that people don't use a sane debug CRT to find these ugly bugs.

Reg312, your solution leaks memory.
I'll do a fix shortly.

Oh, and I guess I'll push the fix for the e3 removal sooner or later. :stressed: