{"action":"opened","issue":{"url":"https://api.github.com/repos/gowong/material-sheet-fab/issues/21","labels_url":"https://api.github.com/repos/gowong/material-sheet-fab/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/gowong/material-sheet-fab/issues/21/comments","events_url":"https://api.github.com/repos/gowong/material-sheet-fab/issues/21/events","html_url":"https://github.com/gowong/material-sheet-fab/issues/21","id":122788708,"number":21,"title":"Memory Leak in MaterialSheetFab","user":{"login":"agrosner","id":2117859,"avatar_url":"https://avatars.githubusercontent.com/u/2117859?v=3","gravatar_id":"","url":"https://api.github.com/users/agrosner","html_url":"https://github.com/agrosner","followers_url":"https://api.github.com/users/agrosner/followers","following_url":"https://api.github.com/users/agrosner/following{/other_user}","gists_url":"https://api.github.com/users/agrosner/gists{/gist_id}","starred_url":"https://api.github.com/users/agrosner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrosner/subscriptions","organizations_url":"https://api.github.com/users/agrosner/orgs","repos_url":"https://api.github.com/users/agrosner/repos","events_url":"https://api.github.com/users/agrosner/events{/privacy}","received_events_url":"https://api.github.com/users/agrosner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-17T17:56:11Z","updated_at":"2015-12-17T17:56:11Z","closed_at":null,"body":"The call:\r\n```java\r\n// Set listener for when FAB view is laid out\r\n\t\tfab.getViewTreeObserver()\r\n\t\t\t\t.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void onGlobalLayout() {\r\n\t\t\t\t\t\t// Initialize FAB anchor when the FAB view is laid out\r\n\t\t\t\t\t\tif (!isFabLaidOut) {\r\n\t\t\t\t\t\t\tupdateFabAnchor();\r\n\t\t\t\t\t\t\tisFabLaidOut = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n```\r\nappears to leak the instance to this sheet (causing my activity to leak), since it's not removed from the `OnGlobalLayoutListener`. \r\nThis was caught using LeakCanary. "}}