Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change where the config dir is created.
On Windows, if there is a `vbam.ini` where the exe is, we should not create the configuration directory `%LOCALAPPDATA%\visualboyadvance-m`.
- Loading branch information
Showing
1 changed file
with
6 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bf6f2d4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The global variable
homeDir
will contain a pointer to unallocated memory.homeDirTmp.c_str()
only return a pointer to the internal buffer of the string object. When the destructor ofhomeDirTmp
is called at the end of its scope the internal buffer is freed. BecausehomeDir
is pointing to the internal buffer ofhomeDirTmp
, this means thathomeDir
is no longer valid. The char string chould be copied usingstrdup
or equivalent.bf6f2d4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FredericHamel thank you for catching this, I'll add a strdup.