Skip to content

Commit e36fb50

Browse files
robot-pigletmaVovk
authored andcommitted
Intermediate changes
commit_hash:86194fc61838b6eca04dee924d646ca679907fbc
1 parent 30a0f87 commit e36fb50

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

util/generic/yexception_ut.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ static inline void Throw2DontMove() {
1111
#include <library/cpp/testing/unittest/registar.h>
1212

1313
#include <util/generic/algorithm.h>
14+
#include <util/generic/scope.h>
1415
#include <util/memory/tempbuf.h>
1516
#include <util/random/mersenne.h>
1617
#include <util/stream/output.h>
@@ -159,7 +160,10 @@ class TExceptionTest: public TTestBase {
159160
auto invalidFormatter = [](IOutputStream*, void* const*, size_t) {
160161
Throw2DontMove();
161162
};
162-
SetFormatBackTraceFn(invalidFormatter);
163+
TFormatBackTraceFn prevFn = SetFormatBackTraceFn(invalidFormatter);
164+
Y_DEFER {
165+
SetFormatBackTraceFn(prevFn);
166+
};
163167

164168
try {
165169
Throw1DontMove();

0 commit comments

Comments
 (0)