Skip to content

Commit 7609191

Browse files
author
Gustavo Brown Rodriguez
committed
Fix in cleanup code (exitApplication)
There are some scenarios where a single process executes GeneXus objects which end up with IsMain being true For example, some GXTest/GXFlow code instantiates procedures without passing them a GxContext. This was making the coverage trace file to try a premature cleanup and the need to start another coverage session
1 parent 5ccf914 commit 7609191

File tree

1 file changed

+6
-1
lines changed
  • dotnet/src/dotnetframework/GxClasses/Model

1 file changed

+6
-1
lines changed

dotnet/src/dotnetframework/GxClasses/Model/gxproc.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,22 @@ protected void exitApplication()
109109
}
110110
private void exitApplication(bool flushBatchCursor)
111111
{
112+
bool inMainExit = false;
112113
if (!(GxContext.IsHttpContext || GxContext.IsRestService) && IsMain && GxApplication.MainContext==context)
114+
{
113115
ThreadUtil.WaitForEnd();
116+
inMainExit = true;
117+
}
114118

115119
if (flushBatchCursor)
116120
{
117121
foreach (IGxDataStore ds in context.DataStores)
118122
ds.Connection.FlushBatchCursors(this);
119123
}
120124

121-
if (IsMain)
125+
if (inMainExit)
122126
dbgInfo?.OnExit();
127+
123128
if (disconnectUserAtCleanup)
124129
{
125130
try

0 commit comments

Comments
 (0)