Avoid memory access to deleted object.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21770 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -109,13 +109,16 @@ status_t FileSelector::Go(entry_ref * ref)
|
|||||||
PostMessage(START_MSG);
|
PostMessage(START_MSG);
|
||||||
acquire_sem(m_exit_sem);
|
acquire_sem(m_exit_sem);
|
||||||
|
|
||||||
if ( m_result == B_OK && ref)
|
// cache result to avoid memory access of deleted window object
|
||||||
m_result = m_entry.GetRef(ref);
|
// after Quit().
|
||||||
|
status_t result = m_result;
|
||||||
|
if ( result == B_OK && ref)
|
||||||
|
result = m_entry.GetRef(ref);
|
||||||
|
|
||||||
Lock();
|
Lock();
|
||||||
Quit();
|
Quit();
|
||||||
|
|
||||||
return m_result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user