So, I'm getting this error in my mod..
Read from location 00000041 caused an access violation.
Location changes ofc..
This happens on either creating the label or setting the text:
myStatsTextField = myStatsWindowPanel.AddUIComponent<UILabel>();
or
myStatsTextField.text = TextFields;
Frustrating thing is it's not consistant.. sometimes it will run for 5-10 minutes, other times it crashes immediately.
I suspect some kind of thread contention going on -- ie: game is updating the UIComponent at the same time I'm trying to..
Is there a safer way to do these calls?
Thanks!
Read from location 00000041 caused an access violation.
Location changes ofc..
This happens on either creating the label or setting the text:
myStatsTextField = myStatsWindowPanel.AddUIComponent<UILabel>();
or
myStatsTextField.text = TextFields;
Frustrating thing is it's not consistant.. sometimes it will run for 5-10 minutes, other times it crashes immediately.
I suspect some kind of thread contention going on -- ie: game is updating the UIComponent at the same time I'm trying to..
Is there a safer way to do these calls?
Code:
========== OUTPUTING STACK TRACE ==================
000000013FFF30F4 (Cities) ShaderLab::FastPropertyName::Init
000000013FFF50B5 (Cities) ShaderLab::FastPropertyName::Init
000000013FFF542B (Cities) ShaderLab::FastPropertyName::Init
000000013FFA645B (Cities) Unity::Material::SetTexture
000000014003B683 (Cities) MaterialPropertyBlock::GetHash
0000000015F1BC01 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Material:SetTexture (int,UnityEngine.Texture)
0000000015F1BB48 (Mono JIT Code) UnityEngine.Material:SetTexture (string,UnityEngine.Texture)
0000000015F1BACA (Mono JIT Code) UnityEngine.Material:set_mainTexture (UnityEngine.Texture)
0000000015F1B91F (Mono JIT Code) ColossalFramework.UI.UIDynamicFont:get_material ()
0000000015F1B802 (Mono JIT Code) ColossalFramework.UI.UIDynamicFont:get_isValid ()
0000000015F1B018 (Mono JIT Code) ColossalFramework.UI.UILabel:Invalidate ()
0000000015F16FD3 (Mono JIT Code) ColossalFramework.UI.UIComponent:InitializeComponent ()
0000000015F16DD7 (Mono JIT Code) ColossalFramework.UI.UIComponent:OnEnable ()
0000000015F343FD (Mono JIT Code) ColossalFramework.UI.UITextComponent:OnEnable ()
0000000004FA8BBB (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
000007FEDC3E3DF7 (mono) mono_set_defaults
000007FEDC3382A1 (mono) mono_runtime_invoke
000000013FF65633 (Cities) ScriptingArguments::AddString
000000013FF65257 (Cities) ScriptingArguments::AddString
000000013FE8D670 (Cities) ReportScriptingObjectsTransfer::operator=
000000013FE9018B (Cities) GetMonoBehaviourInConstructor
000000013FE90567 (Cities) GetMonoBehaviourInConstructor
000000013FF18439 (Cities) DestroyObjectHighLevel
000000013FF186A0 (Cities) DestroyObjectHighLevel
000000013FDECDDC (Cities) CollisionMeshData::AwakeFromLoadThreaded
000000014004668A (Cities) Mesh::GetRuntimeMemorySize
0000000004FDC0FB (Mono JIT Code) (wrapper managed-to-native) UnityEngine.GameObject:Internal_AddComponentWithType (System.Type)
0000000004FDC045 (Mono JIT Code) UnityEngine.GameObject:AddComponent (System.Type)
0000000004FE1861 (Mono JIT Code) UnityEngine.GameObject:AddComponent<object> ()
0000000015F8CEB4 (Mono JIT Code) ColossalFramework.UI.UIComponent:AddUIComponent<object> ()
0000000062AFA0A0 (Mono JIT Code) CSLStatsPanel.StatusWindowInterface:updateText (System.Collections.Generic.List`1<string>)
0000000062A9E1F0 (Mono JIT Code) CSLStatsPanel.ThreadingCSLStatsMod:getstats2 ()
0000000062A9A83D (Mono JIT Code) CSLStatsPanel.ThreadingCSLStatsMod:OnAfterSimulationTick ()
Thanks!