On Sun, Oct 10, 2010 at 11:38 PM, Roger Binns <[email protected]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> The destructor is documented to be called "when the function is deleted,
> either by being overloaded or when the database connection closes".
>  However
> it is also called if the create function call fails which took some
> valgrind
> runs and reading the source to work out.  I guess it is too late to change
> the code to avoid the destructor on error conditions so this behaviour
> should be documented.
>

All the other SQLite interfaces with destructors
(sqlite3_create_module_v2(), sqlite3_bind_text(), sqlite3_bind_blob(),
sqlite3_result_text(), sqlite3_result_blob()) also invoke their destructors
immediately when they fail.  Why is that undesirable?

Except:  sqlite3_create_collation_v2() does *not* invoke its destructor when
it fails.  We are thinking that is a bug and are inclined to fix it.  Is
changing sqlite3_create_collation_v2() to invoke its destructor when it
fails going to cause problems?

Everybody agrees that this needs better documentation.  We'll be fixing that
too, once we determine what ought to be happening.


>
> Roger
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkyyhpYACgkQmOOfHg372QTZEQCfY8f4B+4XTs7cUZviUNlDwk/v
> MtAAnjXC04WWTVcWHz5NU3xxsX1mEHpK
> =tJwO
> -----END PGP SIGNATURE-----
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to