addamsson
01/05/2020, 7:51 PMWeakReference in Kotlin MPP? I have a custom EventBus implementation which returns Subscription objects whenever the user subscribes to an event. My problem is that it is easy to forget to call Subscription.unsubscribe and there can be memory leaks when the subscriber drops the reference to the Subscription but the EventBus retains it forever. Is there a best practice for this scenario in the context of MPP?spierce7
01/05/2020, 7:54 PMWeakReference available in js, so I don’t think there is one. In JS, for the ES6, there is a WeakMap I think.addamsson
01/05/2020, 7:57 PMspierce7
01/05/2020, 7:59 PMspierce7
01/05/2020, 8:00 PMaddamsson
01/05/2020, 8:02 PMaddamsson
01/05/2020, 8:03 PMspierce7
01/05/2020, 8:04 PMspierce7
01/05/2020, 8:04 PMspierce7
01/05/2020, 8:05 PMspierce7
01/05/2020, 8:06 PMaddamsson
01/05/2020, 8:15 PMaddamsson
01/05/2020, 8:15 PMaddamsson
01/05/2020, 8:15 PMaddamsson
01/05/2020, 8:16 PMCLOVIS
09/12/2024, 5:39 PM