]> gitweb.factorcode.org Git - factor.git/commitdiff
windows.com: Prevent release from being called with f, which causes a
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 7 Jun 2015 00:04:02 +0000 (17:04 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 7 Jun 2015 00:04:02 +0000 (17:04 -0700)
segfault.

basis/windows/com/com.factor

index 7b30c71e512ce5236ffd2f3d3def6da4287bb4ff..4aa1bc2512ad3ce9324670b518dc4c272cbe26e5 100644 (file)
@@ -92,8 +92,9 @@ FUNCTION: void ReleaseStgMedium ( LPSTGMEDIUM pmedium ) ;
 : com-add-ref ( interface -- interface )
      [ IUnknown::AddRef drop ] keep ; inline
 
+ERROR: null-com-release ;
 : com-release ( interface -- )
-    IUnknown::Release drop ; inline
+    [ IUnknown::Release drop ] [ null-com-release ] if* ; inline
 
 : with-com-interface ( interface quot -- )
     over [ com-release ] curry [ ] cleanup ; inline