allow garbage collection to free handlers
This commit is contained in:
parent
787a68ac8d
commit
81aa873e41
@ -253,6 +253,8 @@ public class IITC_FileManager {
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int resultCode, Intent data) {
|
||||
mIitc.deleteResponseHandler(this); // to enable garbage collection
|
||||
|
||||
try {
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
Uri uri = data.getData();
|
||||
@ -270,8 +272,8 @@ public class IITC_FileManager {
|
||||
{
|
||||
encoder.write(c);
|
||||
}
|
||||
encoder.close();
|
||||
|
||||
encoder.close();
|
||||
mStreamOut.write("');".getBytes());
|
||||
}
|
||||
|
||||
|
@ -582,6 +582,14 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
|
||||
startActivityForResult(launch, RESULT_FIRST_USER + index);
|
||||
}
|
||||
|
||||
public void deleteResponseHandler(ResponseHandler handler) {
|
||||
int index = mResponseHandlers.indexOf(handler);
|
||||
if (index != -1) {
|
||||
// set value to null to enable garbage collection, but don't remove it to keep indexes
|
||||
mResponseHandlers.set(index, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
int index = requestCode - RESULT_FIRST_USER;
|
||||
|
Loading…
x
Reference in New Issue
Block a user