Skip to content

Commit 1f8bd43

Browse files
johncbaurjeffu231
authored andcommitted
VIX-3796 Adding Background Dispose Logic
VIX-3796 Adding Background Dispose Logic
1 parent 7fc999f commit 1f8bd43

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Vixen.Application/SetupDisplay/ViewModels/SetupDisplayViewModel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ private void SelectBackground()
181181
// If the user selected a file then...
182182
if (result == DialogResult.OK)
183183
{
184+
// If the background class exists then...
185+
if (DisplayPreviewDrawingEngine.Background != null)
186+
{
187+
// Dispose of the previous background
188+
DisplayPreviewDrawingEngine.Background.Dispose();
189+
}
190+
184191
// Assign the background image to the drawing engine
185192
DisplayPreviewDrawingEngine.Background = new PropPreviewBackground(dialog.FileName, 1.0f);
186193
}

0 commit comments

Comments
 (0)