Null fixes
This commit is contained in:
@@ -231,11 +231,12 @@ namespace lime {
|
||||
value lime_file_dialog_save_file (value filter, value defaultPath) {
|
||||
|
||||
#ifdef LIME_NFD
|
||||
return alloc_string (FileDialog::SaveFile (val_string (filter), val_string (defaultPath)));
|
||||
#else
|
||||
return alloc_null ();
|
||||
const char* path = FileDialog::SaveFile (val_string (filter), val_string (defaultPath));
|
||||
if (path) return alloc_string (path);
|
||||
#endif
|
||||
|
||||
return alloc_null ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace lime {
|
||||
|
||||
const char* FileDialog::OpenFile (const char* filter, const char* defaultPath) {
|
||||
|
||||
nfdchar_t *savePath = NULL;
|
||||
nfdchar_t *savePath = 0;
|
||||
nfdresult_t result = NFD_OpenDialog (filter, defaultPath, &savePath);
|
||||
|
||||
switch (result) {
|
||||
@@ -49,7 +49,7 @@ namespace lime {
|
||||
|
||||
}
|
||||
|
||||
//NFD_PathSet_Free (&pathSet);
|
||||
NFD_PathSet_Free (&pathSet);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace lime {
|
||||
|
||||
const char* FileDialog::SaveFile (const char* filter, const char* defaultPath) {
|
||||
|
||||
nfdchar_t *savePath = NULL;
|
||||
nfdchar_t *savePath = 0;
|
||||
nfdresult_t result = NFD_SaveDialog (filter, defaultPath, &savePath);
|
||||
|
||||
switch (result) {
|
||||
|
||||
Reference in New Issue
Block a user