Skip to content

Commit c937fd9

Browse files
authored
context::operator=() leaks tfe_context
Fix memory leak. Previously old `this->tfe_context` would not be deleted
1 parent a6b71df commit c937fd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/cppflow/context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ namespace cppflow {
7979
}
8080

8181
inline context& context::operator=(context&& ctx) noexcept {
82-
tfe_context = std::exchange(ctx.tfe_context, nullptr);
82+
tfe_context = std::exchange(ctx.tfe_context, tfe_context);
8383
return *this;
8484
}
8585

0 commit comments

Comments
 (0)