Follow up from https://github.com/mapbox/mapbox-gl-native/issues/15333#issuecomment-525209827, current Android codebase uses references for Layer and Source API's. This is an issue as we aren't able to determine if a source/layer is still valid. We are currently working around this by flagging (boolean) if a source/layer is detached. With the weak reference setup we can check the weak reference itself to determine if that component is still valid.
An example of to determine if a source/layer is still valid is when a underlying style is reloaded but the user still holds a reference to an old source/layer.
Follow up from https://github.com/mapbox/mapbox-gl-native/issues/15333#issuecomment-525209827, current Android codebase uses references for Layer and Source API's. This is an issue as we aren't able to determine if a source/layer is still valid. We are currently working around this by flagging (boolean) if a source/layer is detached. With the weak reference setup we can check the weak reference itself to determine if that component is still valid.
cc @mapbox/maps-android @pozdnyakov @alexshalamov