chiark
/
gitweb
/
~mdw
/
clg
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d53cf0e
)
Fixed memory leak in with-gvalue
author
espen
<espen>
Mon, 20 Aug 2007 10:50:25 +0000
(10:50 +0000)
committer
espen
<espen>
Mon, 20 Aug 2007 10:50:25 +0000
(10:50 +0000)
glib/gparam.lisp
patch
|
blob
|
blame
|
history
diff --git
a/glib/gparam.lisp
b/glib/gparam.lisp
index d83a3d8a9360c60e8c3c045a449852d826db9a8f..ea3fa447b56c5779eada5a1e52eb5702fbcfa55d 100644
(file)
--- a/
glib/gparam.lisp
+++ b/
glib/gparam.lisp
@@
-20,7
+20,7
@@
;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-;; $Id: gparam.lisp,v 1.2
5 2007-07-03 08:43:21
espen Exp $
+;; $Id: gparam.lisp,v 1.2
6 2007-08-20 10:50:25
espen Exp $
(in-package "GLIB")
(in-package "GLIB")
@@
-42,10
+42,10
@@
(defbinding (%gvalue-init "g_value_init") () nil
(defbinding (gvalue-unset "g_value_unset") () nil
(value gvalue))
(defbinding (gvalue-unset "g_value_unset") () nil
(value gvalue))
-(defun gvalue-init (gvalue type &optional (value nil value-p))
+(defun gvalue-init (gvalue type &optional (value nil value-p)
temp-p
)
(%gvalue-init gvalue (find-type-number type))
(when value-p
(%gvalue-init gvalue (find-type-number type))
(when value-p
- (funcall (writer-function type) value gvalue +gvalue-value-offset+)))
+ (funcall (writer-function type
:temp temp-p
) value gvalue +gvalue-value-offset+)))
(defun gvalue-new (&optional type (value nil value-p))
(let ((gvalue (allocate-memory +gvalue-size+)))
(defun gvalue-new (&optional type (value nil value-p))
(let ((gvalue (allocate-memory +gvalue-size+)))
@@
-99,7
+99,7
@@
(defbinding (gvalue-p "g_type_check_value") () boolean
(defmacro with-gvalue ((gvalue &optional type (value nil value-p)) &body body)
`(with-memory (,gvalue +gvalue-size+)
,(cond
(defmacro with-gvalue ((gvalue &optional type (value nil value-p)) &body body)
`(with-memory (,gvalue +gvalue-size+)
,(cond
- ((and type value-p) `(gvalue-init ,gvalue ,type ,value))
+ ((and type value-p) `(gvalue-init ,gvalue ,type ,value
t
))
(type `(gvalue-init ,gvalue ,type)))
,@body
,(unless value-p `(gvalue-take ,gvalue))))
(type `(gvalue-init ,gvalue ,type)))
,@body
,(unless value-p `(gvalue-take ,gvalue))))