Skip to content

Commit f27c5a0

Browse files
committed
Fix nwjs#7170: App crashes on Windows on call to Window.setBadgeLabel
1 parent fc9b571 commit f27c5a0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/api/nw_window_api.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,11 +557,9 @@ static base::win::ScopedHICON createBadgeIcon(const HWND hWnd, const TCHAR *valu
557557
canvas.DrawCircle(gfx::Point(sizeX / 2, sizeY / 2), sizeX / 2, flags);
558558

559559
// drawing the text
560-
gfx::PlatformFont *platform_font = gfx::PlatformFont::CreateDefault();
560+
scoped_refptr<gfx::PlatformFont> platform_font(gfx::PlatformFont::CreateDefault());
561561
const int fontSize = sizeY * 0.65f;
562562
gfx::Font font(platform_font->GetFontName(), fontSize);
563-
platform_font->Release();
564-
platform_font = NULL;
565563
const int yMargin = (sizeY - fontSize) / 2;
566564
canvas.DrawStringRectWithFlags(value, gfx::FontList(font), SK_ColorWHITE, gfx::Rect(sizeX, fontSize + yMargin + 1), gfx::Canvas::TEXT_ALIGN_CENTER);
567565

0 commit comments

Comments
 (0)