Fix various asset windows shutdown when editor is disposing during crash
This commit is contained in:
@@ -441,6 +441,7 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
{
|
{
|
||||||
if (IsDisposing)
|
if (IsDisposing)
|
||||||
return;
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
Animations.DebugFlow -= OnDebugFlow;
|
Animations.DebugFlow -= OnDebugFlow;
|
||||||
|
|
||||||
_properties = null;
|
_properties = null;
|
||||||
@@ -448,8 +449,6 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
_debugPicker = null;
|
_debugPicker = null;
|
||||||
_showNodesButton = null;
|
_showNodesButton = null;
|
||||||
_previewTab = null;
|
_previewTab = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -438,6 +438,10 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
if (_undo != null)
|
if (_undo != null)
|
||||||
{
|
{
|
||||||
_undo.Enabled = false;
|
_undo.Enabled = false;
|
||||||
@@ -454,8 +458,6 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
_saveButton = null;
|
_saveButton = null;
|
||||||
_undoButton = null;
|
_undoButton = null;
|
||||||
_redoButton = null;
|
_redoButton = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,6 +289,10 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
if (_previewSource)
|
if (_previewSource)
|
||||||
{
|
{
|
||||||
_preview.Source = null;
|
_preview.Source = null;
|
||||||
@@ -297,8 +301,6 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
_previewSource = null;
|
_previewSource = null;
|
||||||
}
|
}
|
||||||
FlaxEngine.Object.Destroy(ref _previewScene);
|
FlaxEngine.Object.Destroy(ref _previewScene);
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -571,14 +571,14 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
{
|
{
|
||||||
if (IsDisposing)
|
if (IsDisposing)
|
||||||
return;
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
ScriptsBuilder.ScriptsReloadBegin -= OnScriptsReloadBegin;
|
ScriptsBuilder.ScriptsReloadBegin -= OnScriptsReloadBegin;
|
||||||
_undo.Enabled = false;
|
_undo.Enabled = false;
|
||||||
_nodePropertiesEditor.Deselect();
|
_nodePropertiesEditor.Deselect();
|
||||||
_knowledgePropertiesEditor.Deselect();
|
_knowledgePropertiesEditor.Deselect();
|
||||||
_undo.Clear();
|
_undo.Clear();
|
||||||
_behaviorPicker = null;
|
_behaviorPicker = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -307,6 +307,8 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
base.OnDestroy();
|
base.OnDestroy();
|
||||||
|
|
||||||
Object.Destroy(ref _collisionWiresShowActor);
|
Object.Destroy(ref _collisionWiresShowActor);
|
||||||
|
|||||||
@@ -320,14 +320,16 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
if (_isRegisteredForScriptsReload)
|
if (_isRegisteredForScriptsReload)
|
||||||
{
|
{
|
||||||
_isRegisteredForScriptsReload = false;
|
_isRegisteredForScriptsReload = false;
|
||||||
ScriptsBuilder.ScriptsReloadBegin -= OnScriptsReloadBegin;
|
ScriptsBuilder.ScriptsReloadBegin -= OnScriptsReloadBegin;
|
||||||
}
|
}
|
||||||
_typeText = null;
|
_typeText = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,11 +90,13 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
Presenter.Deselect();
|
Presenter.Deselect();
|
||||||
Presenter = null;
|
Presenter = null;
|
||||||
Proxy = null;
|
Proxy = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -569,6 +569,10 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
if (_undo != null)
|
if (_undo != null)
|
||||||
_undo.Enabled = false;
|
_undo.Enabled = false;
|
||||||
_propertiesEditor?.Deselect();
|
_propertiesEditor?.Deselect();
|
||||||
@@ -579,8 +583,6 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
_saveButton = null;
|
_saveButton = null;
|
||||||
_undoButton = null;
|
_undoButton = null;
|
||||||
_redoButton = null;
|
_redoButton = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,6 +251,10 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
|
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
_window = null;
|
_window = null;
|
||||||
_dragAssets = null;
|
_dragAssets = null;
|
||||||
_dragActorType = null;
|
_dragActorType = null;
|
||||||
@@ -258,8 +262,6 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
_dragScriptItems = null;
|
_dragScriptItems = null;
|
||||||
_dragHandlers?.Clear();
|
_dragHandlers?.Clear();
|
||||||
_dragHandlers = null;
|
_dragHandlers = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -536,14 +536,16 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
Editor.Prefabs.PrefabApplied -= OnPrefabApplied;
|
Editor.Prefabs.PrefabApplied -= OnPrefabApplied;
|
||||||
ScriptsBuilder.ScriptsReloadBegin -= OnScriptsReloadBegin;
|
ScriptsBuilder.ScriptsReloadBegin -= OnScriptsReloadBegin;
|
||||||
ScriptsBuilder.ScriptsReloadEnd -= OnScriptsReloadEnd;
|
ScriptsBuilder.ScriptsReloadEnd -= OnScriptsReloadEnd;
|
||||||
|
|
||||||
_undo.Dispose();
|
_undo.Dispose();
|
||||||
Graph.Dispose();
|
Graph.Dispose();
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -594,7 +594,12 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
|
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
CancelRendering();
|
CancelRendering();
|
||||||
|
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
_window.Timeline.Enabled = true;
|
_window.Timeline.Enabled = true;
|
||||||
_window.Timeline.Visible = true;
|
_window.Timeline.Visible = true;
|
||||||
_window._toolstrip.Enabled = true;
|
_window._toolstrip.Enabled = true;
|
||||||
@@ -602,8 +607,6 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
_window = null;
|
_window = null;
|
||||||
_presenter = null;
|
_presenter = null;
|
||||||
_options = null;
|
_options = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1030,6 +1033,10 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
Level.ActorDeleted -= OnActorDeleted;
|
Level.ActorDeleted -= OnActorDeleted;
|
||||||
|
|
||||||
if (_previewButton.Checked)
|
if (_previewButton.Checked)
|
||||||
@@ -1056,8 +1063,6 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
_redoButton = null;
|
_redoButton = null;
|
||||||
_renderButton = null;
|
_renderButton = null;
|
||||||
_previewPlayerPicker = null;
|
_previewPlayerPicker = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -734,6 +734,8 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
base.OnDestroy();
|
base.OnDestroy();
|
||||||
|
|
||||||
Object.Destroy(ref _highlightActor);
|
Object.Destroy(ref _highlightActor);
|
||||||
|
|||||||
@@ -184,11 +184,13 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
Presenter.Deselect();
|
Presenter.Deselect();
|
||||||
Presenter = null;
|
Presenter = null;
|
||||||
Proxy = null;
|
Proxy = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,12 +199,12 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
{
|
{
|
||||||
if (IsDisposing)
|
if (IsDisposing)
|
||||||
return;
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
_videoPlayer.Stop();
|
_videoPlayer.Stop();
|
||||||
Object.Destroy(ref _videoPlayer);
|
Object.Destroy(ref _videoPlayer);
|
||||||
_item.RemoveReference(this);
|
_item.RemoveReference(this);
|
||||||
_item = null;
|
_item = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -1373,13 +1373,15 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnDestroy()
|
public override void OnDestroy()
|
||||||
{
|
{
|
||||||
|
if (IsDisposing)
|
||||||
|
return;
|
||||||
|
base.OnDestroy();
|
||||||
|
|
||||||
_undo.Enabled = false;
|
_undo.Enabled = false;
|
||||||
_propertiesEditor.Deselect();
|
_propertiesEditor.Deselect();
|
||||||
_undo.Clear();
|
_undo.Clear();
|
||||||
_debugObjectPicker = null;
|
_debugObjectPicker = null;
|
||||||
_debugToolstripControls = null;
|
_debugToolstripControls = null;
|
||||||
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
Reference in New Issue
Block a user