I found the problematic part in the function, it's around here:
- Code: Select all
char path[FILENAME_MAX];
uint32_t size = sizeof(path);
if(_NSGetExecutablePath(path, &size) != 0){
ofLogError("ofFilePath") << "getCurrentExePath(): path buffer too small, need size " << size;
}
The weird thing is it only shows the behavior if I do specifc things with the `path` variable. For example if this is in a function and I return `path` as a string or if I log it with the OF function
- Code: Select all
ofLogNotice() << path;
, it shows the behavior. But if I do nothing with `path` or cout it, it works. I can also use the ofLogNotice() function to log other chars or strings and it also works. Then I looked if there is some optimization turned on by accident (I'm building debug of course), but it's not. I don't know what to make of this. I have this feeling that the problem might be somewhere else and this is just breaks it for good in some black magic way. And not to forget even if I compile in a way that "it works", the behavior will still show after a random amount of instances created.