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:
Michael Pfeiffer 2007-07-31 16:38:48 +00:00
parent 2535e771cf
commit 66486a1b7d

View File

@ -109,13 +109,16 @@ status_t FileSelector::Go(entry_ref * ref)
PostMessage(START_MSG);
acquire_sem(m_exit_sem);
if ( m_result == B_OK && ref)
m_result = m_entry.GetRef(ref);
// cache result to avoid memory access of deleted window object
// after Quit().
status_t result = m_result;
if ( result == B_OK && ref)
result = m_entry.GetRef(ref);
Lock();
Quit();
return m_result;
return result;
}