浏览代码

fix the crash

Mike Samsonov 5 年之前
父节点
当前提交
91af4b7476
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      code/glTF2/glTF2Asset.inl

+ 1 - 1
code/glTF2/glTF2Asset.inl

@@ -271,7 +271,7 @@ Ref<T> LazyDict<T>::Retrieve(unsigned int i)
     }
 
     // Unique ptr prevents memory leak in case of Read throws an exception
-    auto inst = std::unique_ptr<T>();
+    auto inst = std::unique_ptr<T>(new T());
     inst->id = std::string(mDictId) + "_" + to_string(i);
     inst->oIndex = i;
     ReadMember(obj, "name", inst->name);