]> source.dussan.org Git - tigervnc.git/commitdiff
Don't throw exceptions in destructors
authorPierre Ossman <ossman@cendio.se>
Fri, 15 Sep 2017 13:40:47 +0000 (15:40 +0200)
committerPierre Ossman <ossman@cendio.se>
Fri, 15 Sep 2017 13:40:47 +0000 (15:40 +0200)
common/os/Mutex.cxx

index fcbd0ac7fccd0ca42117781b2e1caa1585bd726c..13013cfbbd08ee26e1f8859abb085e64b7929ba6 100644 (file)
@@ -49,12 +49,8 @@ Mutex::~Mutex()
   DeleteCriticalSection((CRITICAL_SECTION*)systemMutex);
   delete (CRITICAL_SECTION*)systemMutex;
 #else
-  int ret;
-
-  ret = pthread_mutex_destroy((pthread_mutex_t*)systemMutex);
+  pthread_mutex_destroy((pthread_mutex_t*)systemMutex);
   delete (pthread_mutex_t*)systemMutex;
-  if (ret != 0)
-    throw rdr::SystemException("Failed to destroy mutex", ret);
 #endif
 }
 
@@ -106,12 +102,8 @@ Condition::~Condition()
 #ifdef WIN32
   delete (CONDITION_VARIABLE*)systemCondition;
 #else
-  int ret;
-
-  ret = pthread_cond_destroy((pthread_cond_t*)systemCondition);
+  pthread_cond_destroy((pthread_cond_t*)systemCondition);
   delete (pthread_cond_t*)systemCondition;
-  if (ret != 0)
-    throw rdr::SystemException("Failed to destroy condition variable", ret);
 #endif
 }