Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Fix OptionsPanel leaks and API change #19

Merged
merged 1 commit into from
Nov 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions vsintegration/src/FSharp.Editor/Common/FSharpOptionsPanels.fs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ type FSharpSettingsPanel() =
widget.EntryCompilerPath.Text <- if use_default || prop_compiler_path = "" then default_compiler_path else prop_compiler_path
widget.EntryCompilerPath.Sensitive <- not use_default

override x.Dispose() =
if widget <> null then widget.Dispose()
override x.Dispose (disposing:bool) =
if widget <> null then
widget.Dispose()
widget <- null

base.Dispose (disposing)

override x.CreatePanelWidget() =
widget <- new FSharpSettingsWidget()
Expand Down Expand Up @@ -118,11 +122,16 @@ type CodeGenerationPanel() =
| 3 -> "Itanium"
| _ -> "anycpu"

override x.Dispose () =
override x.Dispose (disposing:bool) =
if widget <> null then
widget.Dispose ()
widget <- null

if debugCheckedHandler <> null then
debugCheckedHandler.Dispose()
widget <- null

base.Dispose(disposing)

override x.CreatePanelWidget() =
widget <- new FSharpCompilerOptionsWidget ()
Expand Down