https://kotlinlang.org logo
#announcements
Title
# announcements
d

dragas

08/16/2017, 10:02 AM
is
this::method
actually leaking when called in
init
or
constructor
blocks?
k

karelpeeters

08/16/2017, 10:46 AM
What do you mean exactly? Can you show us some code?
d

dragas

08/16/2017, 10:48 AM
Copy code
addMessageHandler(GatewayHello::class.java, this::onHello)
        addMessageHandler(GatewayAck::class.java, this::onGatewayAck)
        addMessageHandler(GatewayInvalid::class.java, this::onGatewayInvalid)
        addMessageHandler(GatewayReconnect::class.java, this::onGatewayReconnect)
Basically, this snippet implies that when an object of that particular type is passed to coroutine channel (they're all children of
Request
), that particular callback must be called. Note that this is only called in
init
block.
5 Views