소스 검색

Prevent the capnproto connection from getting garbage collected.

David Renshaw 8 년 전
부모
커밋
4d6ab3094c
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      sandstorm.js

+ 2 - 1
sandstorm.js

@@ -28,10 +28,11 @@ if (isSandstorm && Meteor.isServer) {
     Capnp.importSystem('sandstorm/sandstorm-http-bridge.capnp').SandstormHttpBridge;
 
   let httpBridge = null;
+  let capnpConnection = null;
 
   function getHttpBridge() {
     if (!httpBridge) {
-      const capnpConnection = Capnp.connect('unix:/tmp/sandstorm-api');
+      capnpConnection = Capnp.connect('unix:/tmp/sandstorm-api');
       httpBridge = capnpConnection.restore(null, SandstormHttpBridge);
     }
     return httpBridge;