what is exact use case for weak references in your case?
s
spierce7
11/14/2017, 4:13 AM
I've created a dependency injection library for Kotlin that I've been porting to multi-platform. I use weak references to ensure that I don't create memory leaks.
spierce7
11/14/2017, 4:14 AM
I define injected types in an object with delegated properties, and later fill those delegated properties with dependencies when inject is called later on.
spierce7
11/14/2017, 4:15 AM
sometimes inject isn't called during the constructor invocation, but rather later on during an initial lifecycle. In such a case where the object isn't taken through a lifecycle, the injection wouldn't happen, and I'd have a memory leak.
o
olonho
11/14/2017, 4:48 PM
OK, got it. Currently, we do not support weak references, but could consider implementing that, shall there be sufficient demand.