diff --git a/Sources/Core/View/Dialogs/Dialog.swift b/Sources/Core/View/Dialogs/Dialog.swift index e701819..8cac314 100644 --- a/Sources/Core/View/Dialogs/Dialog.swift +++ b/Sources/Core/View/Dialogs/Dialog.swift @@ -113,7 +113,6 @@ public struct Dialog: AdwaitaWidget { if storage.content[dialogID + id]?.first != nil { let dialog = storage.content[dialogID + id]?.first?.opaquePointer adw_dialog_close(dialog?.cast()) - g_object_unref(dialog?.cast()) } } } diff --git a/Sources/Demo/DialogDemo.swift b/Sources/Demo/DialogDemo.swift index ac7dbe2..934e448 100644 --- a/Sources/Demo/DialogDemo.swift +++ b/Sources/Demo/DialogDemo.swift @@ -32,6 +32,7 @@ struct DialogDemo: View { .topToolbar { HeaderBar.empty() } + Button("Close") { dialog = false } } }