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