Skip to content

Commit

Permalink
Fixed Memory Leaks in UiStateManager
Browse files Browse the repository at this point in the history
  • Loading branch information
pavly-gerges committed Aug 22, 2021
1 parent 29fc65f commit fa691d8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -34,7 +34,9 @@ public class UiStateManager extends RelativeLayout {
public UiStateManager(ViewGroup context) {
super(context.getContext());
/*attach the parent View state*/
setLayoutParams(new LayoutParams(context.getLayoutParams().width,context.getLayoutParams().height));
if(context.getLayoutParams() != null) {
setLayoutParams(new LayoutParams(context.getLayoutParams().width, context.getLayoutParams().height));
}
context.addView(this);
this.context=context;
}

0 comments on commit fa691d8

Please sign in to comment.