Use destructors in windows.com
parent
8f4d84373b
commit
9a69ee2f0a
|
@ -1,6 +1,6 @@
|
||||||
USING: alien alien.c-types windows.com.syntax windows.ole32
|
USING: alien alien.c-types alien.destructors windows.com.syntax
|
||||||
windows.types continuations kernel alien.syntax libc
|
windows.ole32 windows.types continuations kernel alien.syntax
|
||||||
destructors accessors ;
|
libc destructors accessors ;
|
||||||
IN: windows.com
|
IN: windows.com
|
||||||
|
|
||||||
LIBRARY: ole32
|
LIBRARY: ole32
|
||||||
|
@ -42,10 +42,4 @@ COM-INTERFACE: IDropTarget IUnknown {00000122-0000-0000-C000-000000000046}
|
||||||
: with-com-interface ( interface quot -- )
|
: with-com-interface ( interface quot -- )
|
||||||
over [ slip ] [ com-release ] [ ] cleanup ; inline
|
over [ slip ] [ com-release ] [ ] cleanup ; inline
|
||||||
|
|
||||||
TUPLE: com-destructor interface disposed ;
|
DESTRUCTOR: com-release
|
||||||
M: com-destructor dispose* interface>> com-release ;
|
|
||||||
|
|
||||||
: &com-release ( interface -- interface )
|
|
||||||
dup f com-destructor boa &dispose drop ;
|
|
||||||
: |com-release ( interface -- interface )
|
|
||||||
dup f com-destructor boa |dispose drop ;
|
|
||||||
|
|
Loading…
Reference in New Issue