Skip to content

Commit 4efa3ed

Browse files
committed
Rewrite CefFrameWrapper::Parent::get - unsure if it would have worked previously, logic now follows CefFrameWrapper::Browser::get()
1 parent ea84e1c commit 4efa3ed

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

CefSharp.Core/Internals/CefFrameWrapper.cpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -283,24 +283,27 @@ IFrame^ CefFrameWrapper::Parent::get()
283283

284284
if (_parentFrame != nullptr)
285285
{
286-
// Be paranoid about creating the cached IBrowser.
287-
msclr::lock sync(_syncRoot);
288-
289-
auto parent = _frame->GetParent();
290-
if (parent != nullptr && _parentFrame != nullptr)
291-
{
292-
_parentFrame = gcnew CefFrameWrapper(parent);
293-
}
294-
else if (parent == nullptr)
295-
{
296-
return nullptr;
297-
}
286+
return _parentFrame;
298287
}
299-
else
288+
289+
// Be paranoid about creating the cached IFrame.
290+
msclr::lock sync(_syncRoot);
291+
292+
if (_parentFrame != nullptr)
300293
{
301294
return _parentFrame;
302295
}
303-
return nullptr;
296+
297+
auto parent = _frame->GetParent();
298+
299+
if (parent == nullptr)
300+
{
301+
return nullptr;
302+
}
303+
304+
_parentFrame = gcnew CefFrameWrapper(parent);
305+
306+
return _parentFrame;
304307
}
305308

306309
///

0 commit comments

Comments
 (0)