{"record":{"id":"c42946673278e980","repo":"linebender/druid","slug":"dialog-was-deleted","errorCode":null,"errorMessage":"Dialog was deleted","messagePattern":"Dialog was deleted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"druid-shell/src/backend/gtk/dialog.rs","lineNumber":101,"sourceCode":"        dialog.set_current_name(default_name);\n    }\n\n    let result = dialog.run();\n\n    let result = match result {\n        ResponseType::Accept => match dialog.filenames() {\n            filenames if filenames.is_empty() => Err(anyhow!(\"No path received for filename\")),\n            // If we receive more than one file, but `multi_selection` is false, return an error.\n            filenames if filenames.len() > 1 && !options.multi_selection => {\n                Err(anyhow!(\"More than one path received for single selection\"))\n            }\n            // If we receive more than one file with a save action, return an error.\n            filenames if filenames.len() > 1 && action == FileChooserAction::Save => {\n                Err(anyhow!(\"More than one path received for save action\"))\n            }\n            filenames => Ok(filenames.into_iter().map(|p| p.into_os_string()).collect()),\n        },\n        ResponseType::Cancel => Err(anyhow!(\"Dialog was deleted\")),\n        _ => {\n            tracing::warn!(\"Unhandled dialog result: {:?}\", result);\n            Err(anyhow!(\"Unhandled dialog result\"))\n        }\n    };\n\n    // TODO properly handle errors into the Error type\n\n    dialog.destroy();\n\n    Ok(result?)\n}\n","sourceCodeStart":83,"sourceCodeEnd":114,"githubUrl":"https://github.com/linebender/druid/blob/0f8b1195e4e073f9597f2865299c3d18f8e4005f/druid-shell/src/backend/gtk/dialog.rs#L83-L114","documentation":"Error arm in get_file_dialog_path: the GTK FileChooserDialog was destroyed/deleted before a result could be read, so dialog.filenames() cannot be retrieved. It fires when the dialog object is dropped prematurely — e.g. the dialog was closed programmatically or its backing widget was disposed while the run loop was active.","triggerScenarios":"Thrown at druid-shell/src/backend/gtk/dialog.rs:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the FileChooserDialog alive until run() returns and filenames are read","Avoid dropping the dialog widget from callbacks while the modal loop is running","Re-open the dialog if it was disposed without a user response"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0f8b1195e4e073f9597f2865299c3d18f8e4005f","analyzedAt":"2026-09-10T14:27:34.582Z","contentChangedAt":"2026-09-10T14:27:34.582Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}