瀏覽代碼

Fix GDNativeLibrary::get_current_library_path()

Return a const String reference to make sure that when its address
is used as a handle in NativeScriptLanguage::init_library(),
it refers to the heap instead of a temporary object on the stack.
Gergely Kis 3 年之前
父節點
當前提交
1583c89a45
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      modules/gdnative/gdnative.h

+ 1 - 1
modules/gdnative/gdnative.h

@@ -76,7 +76,7 @@ public:
 
 
 	// things that change per-platform
 	// things that change per-platform
 	// so there are no setters for this
 	// so there are no setters for this
-	_FORCE_INLINE_ String get_current_library_path() const {
+	_FORCE_INLINE_ const String &get_current_library_path() const {
 		return current_library_path;
 		return current_library_path;
 	}
 	}
 	_FORCE_INLINE_ Vector<String> get_current_dependencies() const {
 	_FORCE_INLINE_ Vector<String> get_current_dependencies() const {