Ticket #62 (assigned defect)
How to use the Tcl binding so cleanup works
| Reported by: | schlenk | Owned by: | olly |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | Xapian-bindings | Version: | SVN trunk |
| Severity: | trivial | Keywords: | |
| Cc: | Blocked By: | ||
| Operating System: | All | Blocking: |
Description
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 constructor 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
