Editor Crash when quitting while in Playmode
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza con la inicialización estática y el finalizador de FastScriptReloadManager; después, inspecciona LoggerScoped.LogInternal y el evento EditorApplication.quitting descrito en el issue. Reproduce el problema cerrando el Unity Editor durante Playmode; se considera terminado cuando el cierre ya no falla al finalizar el manager, mientras la limpieza normal permanece sin cambios.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
So when closing the UnityEditor while in playmode, the Finalizer of FastScriptReloadManager causes Unity to Crash.
Here is the Stack Trace from the Unity Log:
=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
at UnityEngine.DebugLogHandler:Internal_Log <0x000f9>
at UnityEngine.DebugLogHandler:LogFormat <0x000da>
at UnityEngine.Logger:Log <0x001dd>
at ImmersiveVrToolsCommon.Runtime.Logging.LoggerScoped:LogInternal <0x000eb>
at ImmersiveVrToolsCommon.Runtime.Logging.LoggerScoped:LogError <0x00072>
at FastScriptReload.Editor.FastScriptReloadManager:Finalize <0x00172>
at System.Object:runtime_invoke_virtual_void__this__ <0x0018b>
=================================================================
The problem is that LoggerScoped uses UnityEngine.Debug.unityLogger.Log in the background, which is null as soon as Unity is quitting... An exception in that state causes Unity to hard-crash...
private static void LogInternal(LogType logType, object message, Object context)
{
UnityEngine.Debug.unityLogger.Log(logType, string.Empty, (object) (LoggerScoped.LogPrefix + message), context);
}
To fix the issue I created a Flag that is set as reaction to the quitting Event of the Editor Application.
When the flag is set during deconstruction, it exits early and makes no calls to the LoggerScoped.
Cleanup of the FileWatchers should be savely ommittable in this instance as the process is shutting down anyway. The watchers being IDisposables should automatically dispose themselves.
@@ -239,6 +239,10 @@ static FastScriptReloadManager()
//do not add init code in here as with domain reload turned off it won't be properly set on play-mode enter, use Init method instead
EditorApplication.update += Instance.Update;
EditorApplication.playModeStateChanged += Instance.OnEditorApplicationOnplayModeStateChanged;
+ EditorApplication.quitting += () =>
+ {
+ _editorIsClosing = true;
+ };
///if <see cref="FastScriptReloadPreference.WatchOnlySpecified"/> is enabled, disable auto reload automatically when launching editor. Will be enabled automatically when adding file watcher manually
if ((bool)FastScriptReloadPreference.WatchOnlySpecified.GetEditorPersistedValueOrDefault() && SessionState.GetBool("NEED_EDITOR_SESSION_INIT", true))
@@ -248,8 +252,10 @@ static FastScriptReloadManager()
}
}
+ private static bool _editorIsClosing;
~FastScriptReloadManager()
{
+ if (_editorIsClosing) return;
LoggerScoped.LogDebug("Destroying FSR Manager ");
if (_instance != null)
{
- Lenguaje dominante
- C#
- Estrellas
- 2.2k
- Forks
- 169
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de handzlikchris/FastScriptReload
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
handzlikchris/FastScriptReload#202 · 2 reacciones ·
-
csc.rsp supportAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
Failed to find entry-pointsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
handzlikchris/FastScriptReload#203 · 4 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
handzlikchris/FastScriptReload#197 · 1 comentario ·
Todos los issues de handzlikchris/FastScriptReload
Issues similares
-
A numeric literal is parsed in the host's culture, so 1.5 is 15 in a made EXE on a comma-decimal OSAbiertobug interpreter silently-wrong small
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
reactiveui/ReactiveUI.Binding.SourceGenerators#176 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
lugassawan/swe-workbench#799 ·
Los mantenedores suelen responder en 1 día
-
.NET Docs Next Major
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
getsentry/sentry-dotnet#5709 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
plengauer/RicherPresence#132 ·
Los mantenedores suelen responder en 1 día