On 03/08/2016 09:14 AM, Simon Slavin wrote:
> On 8 Mar 2016, at 2:10am, Stephen Chrzanowski <pontiac76 at gmail.com> wrote:
>
>> Out of curiosity, from a memory management standpoint, if I create a memory
>> database, populate simple tables and such, to what falls the responsibility
>> with cleaning up the memory used?
>>
>> Will SQLite handle :memory: databases internally, flushing out the tables
>> from memory?
>>
>> Does my application have to handle dropping the tables before actually
>> closing the connection?
> You can manually DROP the table.
>
> If the table still exists when you close the connection SQLite will DROP the 
> table for you.
>
> If you call sqlite3_shutdown(void) while SQLite still has connections open it 
> will close the connections for you.

I don't think it does that. sqlite3_shutdown() is for embedded platforms 
to shutdown sub-systems initialized by sqlite3_initialize(). Calling it 
with open connections will usually either leak resources or crash.

More here: https://www.sqlite.org/c3ref/initialize.html

Reply via email to