#62 closed defect (fixed)
How to use the Tcl binding so cleanup works
Reported by: | Michael Schlenker | Owned by: | Olly Betts |
---|---|---|---|
Priority: | low | Milestone: | 1.1.5 |
Component: | Xapian-bindings | Version: | SVN trunk |
Severity: | trivial | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Operating System: | All |
Description (last modified by )
The current Tcl binding has problems with cleanup, sometimes the destructor does not get called and other nuisances.
I did some small experiments with the binding and found, that the destructor gets called in some cases and not in others:
This works:
xapian::WritableDatabase xapiandb testdir $::xapian::DB_CREATE_OR_OVERWRITE rename xapiandb ""
This seems it does not:
xapian::WritableDatabase xapiandb testdir $::xapian::DB_CREATE_OR_OVERWRITE set db xapiandb $db -delete
neither does this
set db [xapian::WritableDatabase xapiandb testdir $::xapian::DB_CREATE_OR_OVERWRITE] $db -delete
or this:
set db [xapian::WritableDatabase xapiandb testdir $::xapian::DB_CREATE_OR_OVERWRITE] rename $db ""
I'm not sure if it is a problem with the SWIG wrapping, but thing there are some subtle problems somewhere in there.
Michael
Change History (5)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Status: | new → assigned |
---|
comment:3 by , 18 years ago
Operating System: | → All |
---|---|
Priority: | high → low |
comment:5 by , 16 years ago
Description: | modified (diff) |
---|
(wiki format description and fix typo: "constructor"->"destructor")
comment:6 by , 15 years ago
Milestone: | → 1.1.5 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
As of Xapian 1.1.0, using WritableDatabase's close method is a good way to avoid this whole issue. I've added a note about this to the Tcl8 docs in r14125 (for 1.1.5), and I'm going to close this ticket now - I think we've addressed this as well as we easily can.
It sounds like something isn't quite right inside SWIG, but I don't think I'm qualified to investigate it, since I don't know tcl or the inside of SWIG,
I've added your observations to the tcl bindings documentation, so at least people can work around this problem.