diff options
author | Michael Schroeder <mls@suse.de> | 2014-04-04 14:09:10 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2014-04-04 14:09:10 +0200 |
commit | fdff34f4855b84438b5bff3f79cba33d6bf35865 (patch) | |
tree | 52d95c28d67c6ae1216dc532eec8474c3f9d9e66 /doc | |
parent | b8d3888fdcb2c625f9c025db9ca858ec8199d562 (diff) | |
download | libsolv-fdff34f4855b84438b5bff3f79cba33d6bf35865.tar.gz libsolv-fdff34f4855b84438b5bff3f79cba33d6bf35865.tar.bz2 libsolv-fdff34f4855b84438b5bff3f79cba33d6bf35865.zip |
more swig trickery: automaticall free the pool, add a disown method
Diffstat (limited to 'doc')
-rw-r--r-- | doc/libsolv-bindings.3 | 23 | ||||
-rw-r--r-- | doc/libsolv-bindings.txt | 21 |
2 files changed, 35 insertions, 9 deletions
diff --git a/doc/libsolv-bindings.3 b/doc/libsolv-bindings.3 index 7a9cf54..87e949a 100644 --- a/doc/libsolv-bindings.3 +++ b/doc/libsolv-bindings.3 @@ -2,12 +2,12 @@ .\" Title: Libsolv-Bindings .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets v1.78.0 <http://docbook.sf.net/> -.\" Date: 04/03/2014 +.\" Date: 04/04/2014 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-BINDINGS" "3" "04/03/2014" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-BINDINGS" "3" "04/04/2014" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -390,7 +390,7 @@ my \fI$pool\fR \fB= solv::Pool\->new()\fR; .RE .\} .sp -Create a new pool instance\&. In most cases you just need one pool\&. +Create a new pool instance\&. In most cases you just need one pool\&. Note that the returned object "owns" the pool, i\&.e\&. if the object is freed, the pool is also freed\&. You can use the disown method to break this ownership relation\&. .SS "ATTRIBUTES" .sp .if n \{\ @@ -533,7 +533,22 @@ Make the addfileprovides method only add files from the standard locations (i\&. .RE .\} .sp -Free a pool\&. This is currently done with a method instead of relying on reference counting or garbage collection because it\(cqs hard to track every reference to a pool\&. +Force a free of the pool\&. After this call, you must not access any object that still references the pool\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +\fBvoid disown()\fR +\fI$pool\fR\fB\->disown()\fR; +\fIpool\fR\fB\&.disown()\fR +\fIpool\fR\fB\&.disown()\fR +.fi +.if n \{\ +.RE +.\} +.sp +Break the ownership relation betwen the binding object and the pool\&. After this call, the pool will not get freed even if the object goes out of scope\&. This also means that you must manually call the free method to free the pool data\&. .sp .if n \{\ .RS 4 diff --git a/doc/libsolv-bindings.txt b/doc/libsolv-bindings.txt index e8c4eb9..5a65235 100644 --- a/doc/libsolv-bindings.txt +++ b/doc/libsolv-bindings.txt @@ -201,8 +201,10 @@ Repositories, Dependencies, each indexed by Ids. pool = solv.Pool() pool = Solv::Pool.new() -Create a new pool instance. In most cases you just need -one pool. +Create a new pool instance. In most cases you just need one pool. +Note that the returned object "owns" the pool, i.e. if the object is +freed, the pool is also freed. You can use the disown method to +break this ownership relation. === ATTRIBUTES === @@ -311,9 +313,18 @@ generates. pool.free() pool.free() -Free a pool. This is currently done with a method instead of relying on -reference counting or garbage collection because it's hard to track every -reference to a pool. +Force a free of the pool. After this call, you must not access any object +that still references the pool. + + void disown() + $pool->disown(); + pool.disown() + pool.disown() + +Break the ownership relation betwen the binding object and the pool. After +this call, the pool will not get freed even if the object goes out of +scope. This also means that you must manually call the free method to free +the pool data. void setdebuglevel(int level) $pool->setdebuglevel($level); |