summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Kangas <janne.kangas@qt.io>2019-10-23 07:58:32 +0000
committerJanne Kangas <janne.kangas@qt.io>2019-10-24 08:27:00 +0000
commit8fc13102b639c1b5c294cc0cdd7a61b468d14c0c (patch)
treed1fe46be09489b994f6089a010c4ced22cd5b378
parentaa02107383334d2d5381474ab1acf27e47b515fb (diff)
Revert "Create a completely new instance when material type changes"v2.5.0-rc3
This reverts commit 4a32c1e5a56dd7cfb193cf63870b4c57b8e635df. Reason for revert: Causes crashes elsewhere, and the case that this patch fixes is minor compared to those regressions. Change-Id: Id3afac63c1befe76ee5d9d2099d58694404b7bb2 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
index f5dbe2f7..218cdcd7 100644
--- a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
+++ b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
@@ -1894,11 +1894,8 @@ public:
theSlide, instance);
} else {
CFilePath thePath = m_Doc.GetResolvedPathToDoc(inRelativePathToMaterialFile);
- // Reusing the instance handle for new material seems to cause issues with stale
- // property handles being used, if custom property names match with the names of
- // previous material properties. So we create an entirely new instance.
newMaterial = LoadCustomMaterial(thePath, model, theSlide,
- DocumentEditorInsertType::LastChild, 0);
+ DocumentEditorInsertType::LastChild, 0, instance);
}
if (newMaterial.Valid() && nextChild.Valid())