Skip to content

Commit

Permalink
fix: resolve container settings not saving due to deallocation conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
vapidinfinity committed Nov 10, 2024
1 parent ba4b623 commit bf25315
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Mythic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3067;
CURRENT_PROJECT_VERSION = 3069;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
Expand Down Expand Up @@ -820,7 +820,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3067;
CURRENT_PROJECT_VERSION = 3069;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
Expand Down
5 changes: 3 additions & 2 deletions Mythic/Utilities/Wine/WineInterfaceExt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ extension Wine {
case desktop = #"HKCU\Control Panel\Desktop"#
}

// TODO: refactor
class Container: Codable, Hashable, Identifiable, Equatable {
static func == (lhs: Container, rhs: Container) -> Bool {
return (lhs.url == rhs.url && lhs.id == rhs.id)
Expand Down Expand Up @@ -100,7 +101,7 @@ extension Wine {
self.init(name: url.lastPathComponent, url: url, settings: defaultContainerSettings)
}

deinit { saveProperties() }
// deinit { saveProperties() } // FIXME: causes conflict with didSet

/// Saves the container properties to disk.
func saveProperties() {
Expand All @@ -113,7 +114,7 @@ extension Wine {
}
}

var name: String
var name: String { didSet { saveProperties() } } // MARK: futureproofing
var url: URL
var id: UUID
var settings: ContainerSettings { didSet { saveProperties() } } // FIXME: just for certainty; mythic's still in alpha, remember?
Expand Down

0 comments on commit bf25315

Please sign in to comment.