0
\$\begingroup\$

I'm building up a complete game engine so, basically, it integrate a sound system. The problem is that a line make me crash in my code. The strange thig is that my app crash ONLY when I compile using Release mode, in Debug Mode it run just fine.

I'm using MSVC 16.XX (I don't know exact version, but it is the latest at the time I am asking this question)

(language used is c++)

void PSound::GetDevice()
{
    const ALchar* DeviceList = alcGetString(NULL, ALC_DEVICE_SPECIFIER); //This Line make app crash

    if(DeviceList) {
        while(strlen(DeviceList) > 0) {
            Devices.push_back(DeviceList);
            DeviceList += strlen(DeviceList) + 1;
        }    
    }
}
\$\endgroup\$
4
  • \$\begingroup\$ What line makes your program crash? Often, "only in release" crashes are related to uninitialized variables, try to run the static analyzer on your code and see if it spots any. \$\endgroup\$
    – Vaillancourt
    Commented Mar 19, 2020 at 16:51
  • \$\begingroup\$ @Vaillancourt Oh I'm sorry, I edited my post, so now you can see the problematic line \$\endgroup\$
    – MacEquette
    Commented Mar 19, 2020 at 17:24
  • \$\begingroup\$ I'm not able to offer you a fix for this, but does it happen when there are no audio devices enabled? Do you get the device list in debug? \$\endgroup\$
    – Vaillancourt
    Commented Mar 20, 2020 at 0:50
  • \$\begingroup\$ @Vaillancourt In Debug mode I am totally able to get this list. \$\endgroup\$
    – MacEquette
    Commented Mar 20, 2020 at 8:02

1 Answer 1

0
\$\begingroup\$

Ok, I fixed it. It was a very silly problem. There was a project which where not well linked and all the projects were not using the same Runtime Library.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .