]> git.meshlink.io Git - meshlink/commitdiff
Merge branch 'master' into testing/invitations
authorSaverio Proto <zioproto@gmail.com>
Wed, 11 Jun 2014 17:58:53 +0000 (19:58 +0200)
committerSaverio Proto <zioproto@gmail.com>
Wed, 11 Jun 2014 17:58:53 +0000 (19:58 +0200)
1  2 
src/meshlink.c

diff --combined src/meshlink.c
index b57eb21b7f604d413cf2e31070d2b652e02833d5,e5982721d533aadd2cafb8e775f6dcb7b1555916..c703ddbe6da3bb205ecff27b67bde3fcbe3a62db
@@@ -773,6 -773,11 +773,6 @@@ meshlink_handle_t *meshlink_open(const 
        WSAStartup(MAKEWORD(2, 2), &wsa_state);
  #endif
  
 -      // Setup up everything
 -      // TODO: we should not open listening sockets yet
 -
 -      if(!setup_network(mesh))
 -              return meshlink_close(mesh), NULL;
  
        return mesh;
  }
@@@ -795,10 -800,6 +795,10 @@@ bool meshlink_start(meshlink_handle_t *
                fprintf(stderr, "No name given!\n");
                return false;
        }
 +      // Setup up everything
 +
 +      if(!setup_network(mesh))
 +              return meshlink_close(mesh), NULL;
  
        // Start the main thread
  
@@@ -836,6 -837,8 +836,8 @@@ void meshlink_close(meshlink_handle_t *
        exit_configuration(&mesh->config);
        event_loop_exit(&mesh->loop);
  
+       free(mesh);
  #ifdef HAVE_MINGW
        WSACleanup();
  #endif