From: Otto Moerbeek Date: Wed, 13 Sep 2023 13:22:36 +0000 (+0200) Subject: And another case for catch/throw X-Git-Tag: dnsdist-1.9.0-alpha1~6^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13251%2Fhead;p=thirdparty%2Fpdns.git And another case for catch/throw --- diff --git a/pdns/mtasker.cc b/pdns/mtasker.cc index a02f6bcc9e..1579534718 100644 --- a/pdns/mtasker.cc +++ b/pdns/mtasker.cc @@ -380,7 +380,13 @@ templatebool MTasker::schedule(con ttdindex.erase(i++); // removes the waitpoint notifyStackSwitch(d_threads[d_tid].startOfStack, d_stacksize); - pdns_swapcontext(d_kernel, *uc); // swaps back to the above point 'A' + try { + pdns_swapcontext(d_kernel, *uc); // swaps back to the above point 'A' + } + catch (...) { + notifyStackSwitchDone(); + throw; + } notifyStackSwitchDone(); } else if(i->ttd.tv_sec)