ref: refs/heads/master
commit d08750bc03c8a879a842aa143cbcff8edc0c3223
Author: Klaus Kämpf
Date: Mon Mar 2 17:47:17 2009 +0100
Remove Pool destructor
The pool pointer is mostly passed implicitly, e.g. in Solvable or in
Solver. Removing the Pool destructor prevents garbage collection from
invalidating Pool while being referenced from other objects.
If Pool must be release, use Pool::discard and remember that all
objects originating from this Pool will be invalidated.
---
bindings/pool.i | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/bindings/pool.i b/bindings/pool.i
index 5243a4e..35cbd0d 100644
--- a/bindings/pool.i
+++ b/bindings/pool.i
@@ -87,7 +87,19 @@ typedef struct _Pool {} Pool;
return pool;
}
- ~Pool()
+ /*
+ * discard
+ *
+ * There is no destructor defined for Pool since the pool pointer
+ * is mostly used implicitly (e.g. in Solvable or Solver) which
+ * cannot be reliably tracked in the bindings.
+ *
+ * Deleting the Pool is seldomly needed anyways. Just call
+ * Pool::discard to explicitly free the pool. Just remember that
+ * Solvables originating from this Pool are invalidated.
+ */
+
+ void discard()
{ pool_free($self); }
XSolvable *solvable(int id)
@@ -100,7 +112,7 @@ typedef struct _Pool {} Pool;
#if defined(SWIGRUBY)
%{
/*
- Document-method: Satsolverx::Pool.set_arch
+ Document-method: Satsolver::Pool.set_arch
Defines the architecture of the pool. Only Solvables with a compatible
architecture will be considered.
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org