mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-30 02:50:05 +00:00
Avoided repeated calls to dladdr(), which could cause problems in some plugin situations.
This commit is contained in:
parent
11659678d6
commit
c4af628d14
1 changed files with 12 additions and 3 deletions
|
|
@ -571,9 +571,18 @@ File juce_getExecutableFile()
|
|||
#if JUCE_ANDROID
|
||||
return File (android.appFile);
|
||||
#else
|
||||
Dl_info exeInfo;
|
||||
dladdr ((void*) juce_getExecutableFile, &exeInfo); // (can't be a const void* on android)
|
||||
return File::getCurrentWorkingDirectory().getChildFile (CharPointer_UTF8 (exeInfo.dli_fname));
|
||||
struct DLAddrReader
|
||||
{
|
||||
static String getFilename()
|
||||
{
|
||||
Dl_info exeInfo;
|
||||
dladdr ((void*) juce_getExecutableFile, &exeInfo);
|
||||
return CharPointer_UTF8 (exeInfo.dli_fname);
|
||||
}
|
||||
};
|
||||
|
||||
static String filename (DLAddrReader::getFilename());
|
||||
return File::getCurrentWorkingDirectory().getChildFile (filename);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue