summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiedb/osqlitedriver.cpp9
-rw-r--r--libopie2/opiedb/osqlitedriver.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp
index f07d520..3ba161e 100644
--- a/libopie2/opiedb/osqlitedriver.cpp
+++ b/libopie2/opiedb/osqlitedriver.cpp
@@ -135,9 +135,8 @@ bool OSQLiteDriver::open() {
135 qWarning("OSQLiteDriver::open: %s", error ); 135 qWarning("OSQLiteDriver::open: %s", error );
136 free( error ); 136 free( error );
137 return false; 137 return false;
138 } 138 }
139 sqreg = (sqregex *)malloc(sizeof(sqreg));
140 sqlite_create_function(m_sqlite,"rlike",3,rlikeFunc,&sqreg); 139 sqlite_create_function(m_sqlite,"rlike",3,rlikeFunc,&sqreg);
141 return true; 140 return true;
142} 141}
143 142
@@ -148,12 +147,12 @@ bool OSQLiteDriver::open() {
148 */ 147 */
149bool OSQLiteDriver::close() { 148bool OSQLiteDriver::close() {
150 if (m_sqlite ) 149 if (m_sqlite )
151 sqlite_close( m_sqlite ), m_sqlite=0l; 150 sqlite_close( m_sqlite ), m_sqlite=0l;
152 if (sqreg->regex_raw != NULL){ 151 if (sqreg.regex_raw != NULL){
153 free(sqreg->regex_raw); 152 free(sqreg.regex_raw);
154 sqreg->regex_raw=NULL; 153 sqreg.regex_raw=NULL;
155 regfree(&sqreg->regex_c); 154 regfree(&sqreg.regex_c);
156 } 155 }
157 return true; 156 return true;
158} 157}
159 158
diff --git a/libopie2/opiedb/osqlitedriver.h b/libopie2/opiedb/osqlitedriver.h
index 95c9e2f..adec331 100644
--- a/libopie2/opiedb/osqlitedriver.h
+++ b/libopie2/opiedb/osqlitedriver.h
@@ -40,9 +40,9 @@ private:
40 int handleCallBack( int, char**, char** ); 40 int handleCallBack( int, char**, char** );
41 static int call_back( void*, int, char**, char** ); 41 static int call_back( void*, int, char**, char** );
42 QString m_url; 42 QString m_url;
43 sqlite *m_sqlite; 43 sqlite *m_sqlite;
44 sqregex *sqreg; 44 sqregex sqreg;
45}; 45};
46} 46}
47} 47}
48} 48}