Skip to content

Commit

Permalink
demonstrate HeartbeatBridge never getting killed
Browse files Browse the repository at this point in the history
  • Loading branch information
saniul committed Feb 27, 2015
1 parent d59a6fd commit adbeae6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Examples/Color Puddles/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ touchLayer.touchEndedHandler = touchLayer.touchCancelledHandler = function(touch
}
}

var h = new Heartbeat({handler: function() {
new Heartbeat({handler: function() {
for (layer in touchLayers) {
touchLayers[layer].scale *= 1.11
}
}})
}})
6 changes: 5 additions & 1 deletion PrototopeJSBridge/HeartbeatBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ import JavaScriptCore
handler.callWithArguments([strongSelf])
}
}
JSContext.currentContext().virtualMachine.addManagedReference(self, withOwner: self)
// JSContext.currentContext().virtualMachine.addManagedReference(self, withOwner: self)
} else {
return nil
}
}

deinit {
println("HeartbeatBridge killed")
}

public var paused: Bool {
get { return heartbeat.paused }
Expand Down

0 comments on commit adbeae6

Please sign in to comment.