NullReferenceException: SerializedObject of SerializedProperty has been Disposed.

Forum rules
Please confirm before reporting
  • Please confirm in advance that it is a problem with LogicToolkit and not with Unity itself, other assets, or the user's project.
  • Please confirm that the problem occurs in a project with the smallest possible configuration and clarify how to reproduce it.
  • Please check if it is described in Known Issues.

Information required to report a bug
  • Logic Toolkit version
  • Unity version
  • How to reproduce

=======

報告する前の確認のお願い
  • Unity本体や他のアセット、ユーザーのプロジェクト側による問題ではなくLogicToolkitの問題であることを事前に確認してください。
  • 可能な限り最小構成のプロジェクトで問題の発生を確認し、再現方法を明確にしてください。
  • 既知の問題に記述されているかを確認してください。

バグを報告するために必要な情報
  • Logic Toolkit バージョン
  • Unity バージョン
  • 再現方法

=======

We accept posts in languages ​​other than English and Japanese, but replies will be sent via machine translation.
Thank you for your understanding.

Post a reply

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: NullReferenceException: SerializedObject of SerializedProperty has been Disposed.

Re: NullReferenceException: SerializedObject of SerializedProperty has been Disposed.

by caitsithware » 2025/05/25 00:31

I tried to reproduce the problem but was unable to do so.
This may be a problem that is easily affected by the timing of ComputeNode execution.

For now, I will take the following measures.
  1. Open Packages/com.caitsithware.logictoolkit/Editor/Graph/Dataflow/NodeEditors/ComputeNodeEditor.cs in a code editor
  2. Insert the following code at the beginning of the ComputeNodeBaseEditor class

    Code: Select all

    private bool _IsAttached = false;
  3. Insert the following code at the beginning of the OnAttachToPanel method

    Code: Select all

    _IsAttached = true;
  4. Insert the following code at the beginning of the OnDetachFromPanel method

    Code: Select all

    _IsAttached = false;
  5. Insert the following code at the beginning of the OnPlayModeStateChanged method

    Code: Select all

    if (!_IsAttached) return;
  6. Insert the following code at the beginning of the OnComputed method

    Code: Select all

    if (!_IsAttached) return;

Re: NullReferenceException: SerializedObject of SerializedProperty has been Disposed.

by FunctionOverflu » 2025/05/25 00:06

Thank you!
Yeah I also couldn't find the way to consistently reproduce it, but I will try the method you mentioned if it happens again.

Re: NullReferenceException: SerializedObject of SerializedProperty has been Disposed.

by caitsithware » 2025/05/24 23:51

Thank you for your report.

Based on the log contents, it seems that this occurs when object destruction and ComputeNode processing occur at the same time.
We will confirm the reproducibility and fix it.

If this error starts to occur, the temporary solution is as follows.
  • Open any script
  • Insert a blank line or something and save
  • Wait for compilation and domain reload to complete
This should also unregister the invalid callback.

NullReferenceException: SerializedObject of SerializedProperty has been Disposed.

by FunctionOverflu » 2025/05/24 22:44

Hello,

Logic Toolkit: 1.9.0
Unity: 6000.1.2f1

Once in a while this error keeps showing up in the Unity editor while I am testing the logic toolkit logic.
The only way to stop it is to restart Unity editor, closing the logic editor or opening a different scene doesn't fix it.

Any idea why and how it can be fixed?

Code: Select all

NullReferenceException: SerializedObject of SerializedProperty has been Disposed.
UnityEditor.SerializedProperty.Verify (UnityEditor.SerializedProperty+VerifyFlags verifyFlags) (at <316d3d2a3f8c4b19b769e5bc4918c7d7>:0)
UnityEditor.SerializedProperty.get_longValue () (at <316d3d2a3f8c4b19b769e5bc4918c7d7>:0)
LogicToolkit.Editors.ManagedReferenceDataPropertyBase`1[T].get_Id () (at ./Packages/com.caitsithware.logictoolkit/Editor/Serialization/ManagedReferenceDataProperty.cs:23)
LogicToolkit.Editors.NodeElement.SetActive (System.Boolean isActive) (at ./Packages/com.caitsithware.logictoolkit/Editor/Graph/UIElements/NodeElement.cs:852)
LogicToolkit.Editors.ComputeNodeBaseEditor.OnComputed () (at ./Packages/com.caitsithware.logictoolkit/Editor/Graph/Dataflow/NodeEditors/ComputeNodeEditor.cs:81)
LogicToolkit.Editors.DelayCallback`1+Callback[T].OnUpdate () (at ./Packages/com.caitsithware.logictoolkit/Editor/Graph/Callbacks/DelayCallback.cs:99)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <316d3d2a3f8c4b19b769e5bc4918c7d7>:0)

Top