diff --git a/Source/Editor/Windows/Profiler/CPU.cs b/Source/Editor/Windows/Profiler/CPU.cs
index 23f74aa94..65a18ab2f 100644
--- a/Source/Editor/Windows/Profiler/CPU.cs
+++ b/Source/Editor/Windows/Profiler/CPU.cs
@@ -205,7 +205,6 @@ namespace FlaxEditor.Windows.Profiler
///
public override void OnDestroy()
{
- Clear();
_timelineLabelsCache?.Clear();
_timelineEventsCache?.Clear();
_tableRowsCache?.Clear();
diff --git a/Source/Editor/Windows/Profiler/GPU.cs b/Source/Editor/Windows/Profiler/GPU.cs
index 94e827095..571493f89 100644
--- a/Source/Editor/Windows/Profiler/GPU.cs
+++ b/Source/Editor/Windows/Profiler/GPU.cs
@@ -166,7 +166,6 @@ namespace FlaxEditor.Windows.Profiler
///
public override void OnDestroy()
{
- Clear();
_timelineEventsCache?.Clear();
_tableRowsCache?.Clear();
diff --git a/Source/Editor/Windows/Profiler/ProfilerMode.cs b/Source/Editor/Windows/Profiler/ProfilerMode.cs
index 9b885f886..6d8b81cba 100644
--- a/Source/Editor/Windows/Profiler/ProfilerMode.cs
+++ b/Source/Editor/Windows/Profiler/ProfilerMode.cs
@@ -83,6 +83,14 @@ namespace FlaxEditor.Windows.Profiler
{
}
+ ///
+ public override void OnDestroy()
+ {
+ Clear();
+
+ base.OnDestroy();
+ }
+
///
/// Initializes this instance.
///
diff --git a/Source/Engine/Profiler/ProfilerCPU.h b/Source/Engine/Profiler/ProfilerCPU.h
index b4a4bfdc4..491974ca8 100644
--- a/Source/Engine/Profiler/ProfilerCPU.h
+++ b/Source/Engine/Profiler/ProfilerCPU.h
@@ -22,7 +22,7 @@ public:
///
/// Represents single CPU profiling event data.
///
- API_STRUCT() struct Event
+ API_STRUCT(NoDefault) struct Event
{
DECLARE_SCRIPTING_TYPE_MINIMAL(Event);
diff --git a/Source/Engine/Profiler/ProfilerGPU.h b/Source/Engine/Profiler/ProfilerGPU.h
index caba96b6e..97eacbec3 100644
--- a/Source/Engine/Profiler/ProfilerGPU.h
+++ b/Source/Engine/Profiler/ProfilerGPU.h
@@ -24,7 +24,7 @@ public:
///
/// Represents single CPU profiling event data.
///
- API_STRUCT() struct Event
+ API_STRUCT(NoDefault) struct Event
{
DECLARE_SCRIPTING_TYPE_MINIMAL(Event);
diff --git a/Source/Engine/Profiler/ProfilingTools.h b/Source/Engine/Profiler/ProfilingTools.h
index 28115fcda..dd3d149cb 100644
--- a/Source/Engine/Profiler/ProfilingTools.h
+++ b/Source/Engine/Profiler/ProfilingTools.h
@@ -19,7 +19,7 @@ public:
///
/// The GPU memory stats.
///
- API_STRUCT() struct MemoryStatsGPU
+ API_STRUCT(NoDefault) struct MemoryStatsGPU
{
DECLARE_SCRIPTING_TYPE_MINIMAL(MemoryStatsGPU);
@@ -37,7 +37,7 @@ public:
///
/// Engine profiling data header. Contains main info and stats.
///
- API_STRUCT() struct MainStats
+ API_STRUCT(NoDefault) struct MainStats
{
DECLARE_SCRIPTING_TYPE_MINIMAL(MainStats);
@@ -90,7 +90,7 @@ public:
///
/// The CPU thread stats.
///
- API_STRUCT() struct ThreadStats
+ API_STRUCT(NoDefault) struct ThreadStats
{
DECLARE_SCRIPTING_TYPE_MINIMAL(ThreadStats);