Skip to content

Commit fdf8149

Browse files
committed
Fix potential memory leak with not releasing attacher, thanks to @k3b
1 parent 41f28c1 commit fdf8149

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
}
55

66
dependencies {
7-
classpath 'com.android.tools.build:gradle:2.1.0'
7+
classpath 'com.android.tools.build:gradle:2.1.2'
88
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
99
}
1010
}

library/src/main/java/uk/co/senab/photoview/PhotoView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public void setOnSingleFlingListener(PhotoViewAttacher.OnSingleFlingListener onS
255255
@Override
256256
protected void onDetachedFromWindow() {
257257
mAttacher.cleanup();
258+
mAttacher = null;
258259
super.onDetachedFromWindow();
259260
}
260261

0 commit comments

Comments
 (0)