From a8e6d8315573d10d12b26d3b78c5820e5244dfe8 Mon Sep 17 00:00:00 2001 From: Matt Mower Date: Tue, 14 Feb 2017 20:20:59 -0600 Subject: Do not unconditionally remove MTP storage on unmount * It is not necessary to Remove_MTP_Storage() for a partition if an MTP_Storage_ID has not been assigned. * The hack to force-set tw_mtp_enabled=1 should no longer be necessary now that we're checking whether MTP really needs to be disabled for a volume before running Disable_MTP(). Change-Id: I1b7233eedd9da7c6be0c67fc60243f3837105173 --- partition.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'partition.cpp') diff --git a/partition.cpp b/partition.cpp index 5cf017987..8832909fe 100644 --- a/partition.cpp +++ b/partition.cpp @@ -1318,7 +1318,7 @@ bool TWPartition::UnMount(bool Display_Error) { if (never_unmount_system == 1 && Mount_Point == "/system") return true; // Never unmount system if you're not supposed to unmount it - if (Is_Storage) + if (Is_Storage && MTP_Storage_ID > 0) PartitionManager.Remove_MTP_Storage(MTP_Storage_ID); if (!Symlink_Mount_Point.empty()) -- cgit v1.2.3