Skip to content

Commit bbd2312

Browse files
committed
[[ BrowserWidget ]] Fix faulty ref counting logic resulting to non-release of browsers
1 parent 6509e11 commit bbd2312

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libbrowser/src/libbrowser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
MCBrowserRefCounted::MCBrowserRefCounted()
2929
{
30-
m_ref_count = 0;
30+
m_ref_count = 1;
3131
}
3232

3333
void MCBrowserRefCounted::Retain()
@@ -37,7 +37,7 @@ void MCBrowserRefCounted::Retain()
3737

3838
void MCBrowserRefCounted::Release()
3939
{
40-
if (--m_ref_count > 1)
40+
if (m_ref_count-- > 1)
4141
return;
4242

4343
Destroy();

0 commit comments

Comments
 (0)