ProjectBorealis / UEGitPlugin

Unreal Engine Git Source Control Plugin (refactored)
MIT License
512 stars 104 forks source link

[bug] A quick shutdown will cause a crash #174

Open zhaozigu opened 3 months ago

zhaozigu commented 3 months ago

Steps to Reproduce:

  1. User opens the project in Unreal Editor;
  2. Immediately after entering the interface, quickly close the editor;
  3. This will ultimately trigger an error.
Assertion failed: !IsInGameThread() [File: Plugins\UEGitPlugin\Source\GitSourceControl\Private\GitSourceControlModule.h] [Line: 128]

Cause of the Crash:

    static inline FGitSourceControlModule* GetThreadSafe()
    {
        IModuleInterface* ModulePtr = FModuleManager::Get().GetModule("GitSourceControl");
        if (!ModulePtr)
        {
            // Main thread should never have this unloaded.
            check(!IsInGameThread());
            return nullptr;
        }
        return static_cast<FGitSourceControlModule*>(ModulePtr);
    }

check triggered an assertion failure.

zhaozigu commented 3 months ago

However, this does not seem to be a problem that can be definitively repeated.

mastercoms commented 3 months ago

Do you have the full call stack?

zhaozigu commented 3 months ago

@mastercoms

Assertion failed: !IsInGameThread() [File:E:\work\VersionGit\Plugins\UEGitPlugin\Source\GitSourceControl\Private\GitSourceControlModule.h] [Line: 128]

UnrealEditor_GitSourceControl!GitSourceControlUtils::UpdateCachedStates() [E:\work\VersionGit\Plugins\UEGitPlugin\Source\GitSourceControl\Private\GitSourceControlUtils.cpp:2180]
UnrealEditor_GitSourceControl!``FGitSourceControlProvider::CheckRepositoryStatus'::`2'::<lambda_1>::operator()'::`10'::<lambda_2>::operator()() [E:\work\VersionGit\Plugins\UEGitPlugin\Source\GitSourceControl\Private\GitSourceControlProvider.cpp:170]
UnrealEditor_Core
UnrealEditor_Core
UnrealEditor_Core
UnrealEditor_RenderCore
UnrealEditor_WindowsMoviePlayer
UnrealEditor_WindowsMoviePlayer
UnrealEditor_WindowsMoviePlayer
UnrealEditor_WindowsMoviePlayer
UnrealEditor_Core
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll

I think it's because of the thread.