feat: catch exception for error in thread

develop
paring 2022-11-09 17:11:51 +09:00
parent 3c29035c02
commit 6a37539b37
Signed by: pikokr
GPG Key ID: DB839724AD14EC9F
1 changed files with 19 additions and 11 deletions

View File

@ -79,20 +79,28 @@ namespace SkyHook
new Thread(() =>
{
if (isHookActive) return;
var result = SkyHookNative.StartHook(HookCallback);
if (result != null)
try
{
exception = new SkyHookException(result);
if (isHookActive) return;
var result = SkyHookNative.StartHook(HookCallback);
if (result != null)
{
exception = new SkyHookException(result);
}
isHookActive = true;
started = true;
while (isHookActive)
{
}
}
isHookActive = true;
started = true;
while (isHookActive)
catch (Exception e)
{
exception = e;
throw;
}
}).Start();