free the QueriesLog structure's content
| 144 | |
| 145 | // free the QueriesLog structure's content |
| 146 | void QueriesLog_Free |
| 147 | ( |
| 148 | QueriesLog log // queries log |
| 149 | ) { |
| 150 | ASSERT(log != NULL); |
| 151 | |
| 152 | LoggedQuery *q = NULL; |
| 153 | CircularBuffer_ResetReader(log->queries); |
| 154 | |
| 155 | while((q = CircularBuffer_Read(log->queries, NULL)) != NULL) { |
| 156 | // clean up |
| 157 | if(q->query != NULL) { |
| 158 | rm_free(q->query); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | CircularBuffer_Free(log->swap); |
| 163 | CircularBuffer_Free(log->queries); |
| 164 | |
| 165 | pthread_rwlock_destroy(&log->rwlock); |
| 166 | |
| 167 | rm_free(log); |
| 168 | } |
| 169 |
no test coverage detected