提交 19ac9231 编写于 作者: L Lion

safely duplicate close

上级 ca4bffbc
......@@ -50,6 +50,7 @@ XDB_PUBLIC(int) xdb_new_with_buffer(xdb_searcher_t *xdb, const char *c_buffer) {
XDB_PUBLIC(void) xdb_close(xdb_searcher_t *xdb) {
if (xdb->handle != NULL) {
fclose(xdb->handle);
xdb->handle = NULL;
}
}
......@@ -339,4 +340,4 @@ XDB_PUBLIC(long) xdb_now() {
struct timeval c_time;
gettimeofday(&c_time, NULL);
return c_time.tv_sec * (int)1e6 + c_time.tv_usec;
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册