include/osl/mutex.hxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit c1e320836b7dbcd9fe6ded8352355ea6101bd821
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Tue Apr 9 16:53:52 2019 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Tue Apr 9 19:15:05 2019 +0200

    Add asserts to *Guard pointer constructors...
    
    ... as we can't drop them. IMHO it's still better then just a
    crash. Has to use NULL, as the API is pre-C++11 compatible.
    
    Change-Id: Idb4395d14a9185f4d7d1c2f048ad950518eef133
    Reviewed-on: https://gerrit.libreoffice.org/70465
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    Tested-by: Jenkins

diff --git a/include/osl/mutex.hxx b/include/osl/mutex.hxx
index c2ee448d868e..5bcf0e56cce0 100644
--- a/include/osl/mutex.hxx
+++ b/include/osl/mutex.hxx
@@ -22,6 +22,7 @@
 
 #include "osl/mutex.h"
 
+#include <cassert>
 
 namespace osl
 {
@@ -119,6 +120,7 @@ namespace osl
         */
         Guard(T * pT_) : pT(pT_)
         {
+            assert(pT != NULL);
             pT->acquire();
         }
 
@@ -153,6 +155,7 @@ namespace osl
         */
         ClearableGuard(T * pT_) : pT(pT_)
         {
+            assert(pT != NULL);
             pT->acquire();
         }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to