Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5821,9 +5821,20 @@ internal static void Submit(WaitCallback callbak, object state)
ThreadPool.QueueUserWorkItem(
arg =>
{
callbak(state);
resetEvent.Set();
events.TryRemove(eventGuid, out ManualResetEvent _);
try
{
callbak(state);
}
catch (Exception ex)
{
GXLogging.Error(log, "Error on submit of " + state.GetType(), ex);
throw;
}
finally
{
resetEvent.Set();
events.TryRemove(eventGuid, out ManualResetEvent _);
}

});
events[eventGuid]= resetEvent;
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/dotnetframework/GxClasses/Model/gxproc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected void exitApplication()
}
private void exitApplication(bool flushBatchCursor)
{
if (IsMain && !(context as GxContext).IsSubmited)
if (!(GxContext.IsHttpContext || GxContext.IsRestService) && IsMain && !(context as GxContext).IsSubmited)
ThreadUtil.WaitForEnd();

if (flushBatchCursor)
Expand Down