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
11 changes: 8 additions & 3 deletions src/yvalve/YObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class YRequest;
class YResultSet;
class YService;
class YStatement;
class IscStatement;
class YTransaction;

class YObject
Expand Down Expand Up @@ -98,10 +99,13 @@ class HandleArray
void destroy(unsigned dstrFlags)
{
Firebird::MutexLockGuard guard(mtx, FB_FUNCTION);
FB_SIZE_T i;

while ((i = array.getCount()) > 0)
array[i - 1]->destroy(dstrFlags);
// Call destroy() only once even if handle is not removed from array
// by this call for any reason
for (int i = array.getCount() - 1; i >= 0; i--)
array[i]->destroy(dstrFlags);

clear();
}

void assign(HandleArray& from)
Expand Down Expand Up @@ -473,6 +477,7 @@ class YAttachment FB_FINAL :
HandleArray<YEvents> childEvents;
HandleArray<YRequest> childRequests;
HandleArray<YStatement> childStatements;
HandleArray<IscStatement> childIscStatements;
HandleArray<YTransaction> childTransactions;
Firebird::Array<CleanupCallback*> cleanupHandlers;
Firebird::StatusHolder savedStatus; // Do not use raise() method of this class in yValve.
Expand Down
Loading