Hi all,
I am having real problems with SQLite on Windows CE (.NET 4.1 and Pocket PC
2003).
I have tried everything and it seems that there is a memory leak with SQLite on
Windows CE.
I have test it with SQLite versions 3.2.2 and 3.3.4 and SQLite seems that it
reserves memory and doesn´t free it after using it, memery is freed only after
the main program has finished.
Take this simple example (it fails also with more complicated ones). I have
test it using a quite big table (20,000 records).
Please i really need help, because my program consumes all the memory and i
need to finish it next week:
Here is the sample source code to test (this is done with EVC 4.0 and a MFC
application)
void CMemoryMDlg::OnButton1()
{
char *errmsg;
char **result;
sqlite3 *db;
int ret, rows, cols;
int n = sqlite3_open("\\mysqlitebd.db", &db);
if (db == 0)
{
MessageBox(_T("Error openning BD"),_T(""),MB_OK);
return;
}
ret = sqlite3_get_table(db, "SELECT * FROM artic", &result,
&rows, &cols, &errmsg);
if (ret != SQLITE_OK)
{
MessageBox(_T("Error en SQL"),_T("Error"),MB_OK);
sqlite3_free(errmsg);
return;
}
else {
MessageBox(_T("Error on SQL
sentence"),_T("Error"),MB_OK);
}
sqlite3_free_table(result);
sqlite3_close(db);
}
Automóviles, telefonía, imagen y sonido, belleza... ¡encuentra gratis todo lo
que necesitas! http://clasificados.wanadoo.es/