mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-25 12:03:27 +00:00
Merge remote-tracking branch 'philoinc/master'
This commit is contained in:
@@ -72,6 +72,12 @@ public class SvgView extends ViewGroup {
|
||||
SvgViewManager.setSvgView(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
SvgViewManager.dropSvgView(this);
|
||||
}
|
||||
|
||||
public void setBitmap(Bitmap bitmap) {
|
||||
if (mBitmap != null) {
|
||||
mBitmap.recycle();
|
||||
|
||||
@@ -51,6 +51,12 @@ class SvgViewManager extends ViewGroupManager<SvgView> {
|
||||
mTagToSvgView.put(svg.getId(), svg);
|
||||
}
|
||||
|
||||
static void dropSvgView(SvgView view) {
|
||||
int tag = view.getId();
|
||||
mTagToShadowNode.remove(tag);
|
||||
mTagToSvgView.remove(tag);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
static @Nullable SvgView getSvgViewByTag(int tag) {
|
||||
return mTagToSvgView.get(tag);
|
||||
@@ -77,13 +83,6 @@ class SvgViewManager extends ViewGroupManager<SvgView> {
|
||||
return node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDropViewInstance(SvgView view) {
|
||||
int tag = view.getId();
|
||||
mTagToShadowNode.remove(tag);
|
||||
mTagToSvgView.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SvgView createViewInstance(ThemedReactContext reactContext) {
|
||||
return new SvgView(reactContext);
|
||||
|
||||
Reference in New Issue
Block a user