Skip to content

Commit 1abdc14

Browse files
committed
Cherrypick fix.
1 parent e41ed96 commit 1abdc14

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ClientSource/Connection/BotBase.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ BotBaseContext::BotBaseContext(CancellableScope& parent, BotBaseContext& context
2929
}
3030
BotBaseContext::~BotBaseContext(){
3131
m_lifetime_sanitizer.check_usage();
32+
detach();
3233
try{
3334
m_botbase.wait_for_all_requests(this);
34-
}catch (...){}
35-
detach();
35+
}catch (...){
36+
// cout << "canceled with exception: " << this << endl;
37+
CancellableScope* parent = scope();
38+
if (parent){
39+
parent->cancel(std::current_exception());
40+
}
41+
}
3642
}
3743

3844
void BotBaseContext::wait_for_all_requests() const{

0 commit comments

Comments
 (0)