[Xapian-discuss] TCL Binding working, but db_lock doesn't get removed?

Eric Parusel eparusel at creativens.com
Thu Oct 21 23:27:45 BST 2004


Eric Parusel wrote:
> Olly Betts wrote:
> 
>>> Is there a particular way I should be destroying the WritableDatabase 
>>> object?
>>
>>  
>> For Tcl, I really don't know - sorry!  Perhaps Michael will be able to
>> suggest something.
>>
>> It's not just the lock file - unless you explicitly flush before the
>> script exits, you're rely on the destructor to flush the last batch
>> of changes.
> 
> 
> Ok, I did find that I had to "db flush" for the document to be added...
> (I was printing out the document count much like the tcl examples posted 
> to the list)
> 
> I did try "db -destroy" at the end of my test script (which ran without 
> errors) -- however the lock file stayed put...
> I read somewhere that -destroy would get rid of the object... *shrug*

 From http://www.swig.org/Doc1.1/HTML/Tcl.html#n5
********************************************************************
Deleting objects
Since objects are created by adding new Tcl commands, they can be 
deleted by simply renaming them. For example :

% rename l ""                # Destroy list object `l'


SWIG will automatically call the corresponding C/C++ destructor, with 
one caveat--SWIG will not destroy an object if you created it from an 
already existing pointer (if you called the constructor using the -this 
option). Since the pointer already existed when you created the Tcl 
object, Tcl doesn't own the object so it would probably be a bad idea to 
destroy it.
********************************************************************

rename db "" works, but seemingly xapian object doesn't get destroyed, 
same as before :(

Maybe this is something I should take up with "the SWIG people"?

Eric



More information about the Xapian-discuss mailing list