Skip to content

Commit 49ce692

Browse files
committed
Add OwnershipReplaceSingleUseHelper destructor
1 parent bdfcc60 commit 49ce692

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/swift/SILOptimizer/Utils/OwnershipOptUtils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ class OwnershipReplaceSingleUseHelper {
196196
OwnershipReplaceSingleUseHelper(OwnershipFixupContext &ctx, Operand *use,
197197
SILValue newValue);
198198

199+
~OwnershipReplaceSingleUseHelper() { if (ctx) ctx->clear(); }
200+
199201
/// Returns true if this helper was initialized into a valid state.
200202
operator bool() const { return isValid(); }
201203
bool isValid() const { return bool(ctx) && bool(use) && bool(newValue); }

0 commit comments

Comments
 (0)