Browse Source

Ensure dictionary for LazyDics is created before adding content to it

Kim Kulling 3 năm trước cách đây
mục cha
commit
6f31254ae1
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      code/AssetLib/glTF2/glTF2Asset.h

+ 4 - 2
code/AssetLib/glTF2/glTF2Asset.h

@@ -1090,6 +1090,8 @@ class Asset {
     friend struct Buffer; // To access OpenFile
     friend class AssetWriter;
 
+    std::vector<LazyDictBase *> mDicts;
+
 public:
     //! Keeps info about the enabled extensions
     struct Extensions {
@@ -1156,7 +1158,8 @@ public:
     Ref<Scene> scene;
 
 public:
-    Asset(IOSystem *io = nullptr, rapidjson::IRemoteSchemaDocumentProvider *schemaDocumentProvider = nullptr) : 
+    Asset(IOSystem *io = nullptr, rapidjson::IRemoteSchemaDocumentProvider *schemaDocumentProvider = nullptr) :
+            mDicts(),
             extensionsUsed(),
             extensionsRequired(),
             asset(),
@@ -1217,7 +1220,6 @@ private:
     size_t mSceneLength;
     size_t mBodyOffset;
     size_t mBodyLength;
-    std::vector<LazyDictBase *> mDicts;
     IdMap mUsedIds;
     Ref<Buffer> mBodyBuffer;
 };