I set the location of the log file to a folder, I then moved the folder, Cxbx.exe would then hang or crash upon loading again.
Had to delete the keys:
HKEY_CURRENT_USERSoftwareCxbx-Reloaded
To get working again.
Cxbx doesn't crash/freeze if I set the keys KrnlDebugFilename and CxbxDebugFilename to an empty string after moving the folder. This code could fix this issue then?
In WndMain.cpp:127
if(RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\Cxbx-Reloaded", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_QUERY_VALUE | KEY_SET_VALUE, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS)
And adding this in WndMain.cpp:149
dwType = REG_SZ; dwSize = 0;
if(PathFileExists((LPCSTR)m_CxbxDebugFilename) == FALSE)
{
RegSetValueEx(hKey, "CxbxDebugFilename", 0, dwType, NULL, dwSize);
}
dwType = REG_SZ; dwSize = 0;
if(PathFileExists((LPCSTR)m_KrnlDebugFilename) == FALSE)
{
RegSetValueEx(hKey, "KrnlDebugFilename", 0, dwType, NULL, dwSize);
}
Why not test and submit a PR ;)
@ergo720 What Luke said : Please submit a Pull Request for this, we'll be happy to test and merge (plus it will turn you into a contributor!)
I am sure it works, I have tested it in Visual Studio with a small test program and it correctly sets the key to an empty string. Alright, I'll submit a PR then
After more thought I realized the above code doesn't completely fix the issue. Check the PR for the new version
We cannot close this, cxbx now crashes if I try to set a debug folder location
Alright, I have changed my fix and built Cxbx in Visual Studio 2017 with it and this time it works. I'll submit a new PR
The problem is solved: from c5e4016 cxbx doesn't crash/freeze anymore after moving/renaming the debug folder. Sorry for not testing better the last time!
If you set Debug Output on either and restart the application, the settings aren't saved or loaded properly now.
@ergo720 Could you take a look at the regression @Sarkie mentions above?
It seems that this error is rare: I was only able to reproduce it once but even then only the Xinput flag option had a garbage value, the other options were still all correct. I also tried to clear all the registry settings and download the latest version but the error still didn't occur...
I will test again and take a video
@Sarkie were you able to reproduce this?
Most helpful comment
I am sure it works, I have tested it in Visual Studio with a small test program and it correctly sets the key to an empty string. Alright, I'll submit a PR then