diff --git a/ChangeLog b/ChangeLog index d848ac87..a0b6291d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,10 @@ Chris Caudle Jackdmp changes log --------------------------- +2011-06-29 Stephane Letz + + * Special CATCH_CLOSE_EXCEPTION_RETURN to handle Close API calls. + 2011-06-28 Stephane Letz * Another round of code improvements to handle completely buggy Digidesign CoreAudio user-land driver. diff --git a/common/JackLockedEngine.h b/common/JackLockedEngine.h index 45b1c6a0..cba72a26 100644 --- a/common/JackLockedEngine.h +++ b/common/JackLockedEngine.h @@ -41,17 +41,26 @@ catch (...) { */ #define CATCH_EXCEPTION_RETURN \ + } catch(std::bad_alloc& e) { \ + jack_error("Memory allocation error..."); \ + return -1; \ + } catch (...) { \ + jack_error("Unknown error..."); \ + throw; \ + } \ + +#define CATCH_CLOSE_EXCEPTION_RETURN \ } catch(std::bad_alloc& e) { \ jack_error("Memory allocation error..."); \ return -1; \ } catch(JackTemporaryException& e) { \ jack_error("JackTemporaryException : now quits..."); \ JackTools::KillServer(); \ - return -1; \ + return 0; \ } catch (...) { \ jack_error("Unknown error..."); \ throw; \ - } \ + } #define CATCH_EXCEPTION \ } catch(std::bad_alloc& e) { \ @@ -122,15 +131,15 @@ class SERVER_EXPORT JackLockedEngine { TRY_CALL JackLock lock(&fEngine); - return (fEngine.CheckClient(refnum)) ? fEngine.ClientExternalClose(refnum) : - 1; - CATCH_EXCEPTION_RETURN + return (fEngine.CheckClient(refnum)) ? fEngine.ClientExternalClose(refnum) : -1; + CATCH_CLOSE_EXCEPTION_RETURN } int ClientInternalClose(int refnum, bool wait) { TRY_CALL JackLock lock(&fEngine); return (fEngine.CheckClient(refnum)) ? fEngine.ClientInternalClose(refnum, wait) : -1; - CATCH_EXCEPTION_RETURN + CATCH_CLOSE_EXCEPTION_RETURN } int ClientActivate(int refnum, bool is_real_time)