It is not really important to free memory on program exit, but it makes it
easier to see real memory leaks.
Found with valgrind.
return server;
}
+void
+ovsdb_jsonrpc_server_destroy(struct ovsdb_jsonrpc_server *svr)
+{
+ struct shash_node *node, *next;
+
+ SHASH_FOR_EACH_SAFE (node, next, &svr->remotes) {
+ ovsdb_jsonrpc_server_del_remote(node);
+ }
+ shash_destroy(&svr->remotes);
+ free(svr);
+}
+
/* Sets 'svr''s current set of remotes to the names in 'new_remotes'. The data
* values in 'new_remotes' are ignored.
*
-/* Copyright (c) 2009 Nicira Networks
+/* Copyright (c) 2009, 2010 Nicira Networks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
struct shash;
struct ovsdb_jsonrpc_server *ovsdb_jsonrpc_server_create(struct ovsdb *);
+void ovsdb_jsonrpc_server_destroy(struct ovsdb_jsonrpc_server *);
void ovsdb_jsonrpc_server_set_remotes(struct ovsdb_jsonrpc_server *,
const struct shash *);
ovsdb_trigger_wait(db, time_msec());
poll_block();
}
+ ovsdb_jsonrpc_server_destroy(jsonrpc);
+ ovsdb_destroy(db);
+ shash_destroy(&remotes);
+ unixctl_server_destroy(unixctl);
return 0;
}