Skip to content

Commit

Permalink
修复server#stop node未释放的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
frodosens committed Sep 3, 2014
1 parent 20d9b31 commit 92234d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions FSNet/fs_server.c
Expand Up @@ -340,9 +340,9 @@ fs_server_start(struct fs_server* server, struct fs_node_addr* addr, enum fs_ser


void
__hahs_destroy_fn(void* data){
if(data){
struct fs_node* node = (struct fs_node*)data;
__hash_each(const char* key, void* val, const void* server){
if(val){
struct fs_node* node = (struct fs_node*)val;
fs_node_shudown(node);
}
}
Expand Down Expand Up @@ -378,6 +378,7 @@ fs_server_stop(struct fs_server* server, int32_t what){


if(server->node_map){
sm_enum(server->node_map, __hash_each, server);
sm_delete(server->node_map);
server->node_map = NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion FSNet/hash.h
Expand Up @@ -64,7 +64,7 @@ extern "C"
*
* Return value: None.
*/
typedef void(*sm_enum_func)(const char *key, const char *value, const void *obj);
typedef void(*sm_enum_func)(const char *key, void *value, const void *obj);

/*
* Creates a string map.
Expand Down

0 comments on commit 92234d3

Please sign in to comment.