diff --git a/Sources/YMFF/FeatureFlagResolver/Store/UserDefaultsStore.swift b/Sources/YMFF/FeatureFlagResolver/Store/UserDefaultsStore.swift index 8176fad..19895c0 100644 --- a/Sources/YMFF/FeatureFlagResolver/Store/UserDefaultsStore.swift +++ b/Sources/YMFF/FeatureFlagResolver/Store/UserDefaultsStore.swift @@ -28,6 +28,10 @@ final public class UserDefaultsStore { self.userDefaults = userDefaults } + deinit { + userDefaults.synchronize() + } + } // MARK: - SynchronousMutableFeatureFlagStore @@ -48,10 +52,6 @@ extension UserDefaultsStore: SynchronousMutableFeatureFlagStore { userDefaults.removeObject(forKey: key) } - public func saveChangesSync() { - userDefaults.synchronize() - } - } #endif