Skip to content

Commit

Permalink
[fix] #24
Browse files Browse the repository at this point in the history
メモリリーク修正
  • Loading branch information
Cilda committed Oct 28, 2022
1 parent 84636a0 commit 90b64b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions UmaUmaChecker/PreviewFrame.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "PreviewFrame.h"

#include <Windows.h>
#include <wx/sizer.h>
#include <wx/dcclient.h>
#include <wx/dcmemory.h>
Expand Down Expand Up @@ -33,6 +34,10 @@ PreviewFrame::~PreviewFrame()

void PreviewFrame::SetImage(WXHBITMAP hBmp, int width, int height)
{
WXHBITMAP hOldBmp = image.GetHBITMAP();
if (hOldBmp) {
DeleteObject(hOldBmp);
}
image.InitFromHBITMAP(hBmp, width, height, 32);
this->Refresh();
}
Expand Down

0 comments on commit 90b64b9

Please sign in to comment.