MouseDownThread: let thread terminate cleanly.
* Killing the thread leaks resources, and it will terminate cleanly and safely when the destructor exits anyway. * Fixes #12293. Thanks to ttcoder, jackburton and bonefish for investigating! * Does not fix #12286. Going to bissect now...
This commit is contained in:
@@ -365,11 +365,6 @@ MouseDownThread<View>::MouseDownThread(View* view,
|
|||||||
template<class View>
|
template<class View>
|
||||||
MouseDownThread<View>::~MouseDownThread()
|
MouseDownThread<View>::~MouseDownThread()
|
||||||
{
|
{
|
||||||
if (fThreadID > 0) {
|
|
||||||
kill_thread(fThreadID);
|
|
||||||
// dead at this point
|
|
||||||
TRESPASS();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -393,7 +388,6 @@ MouseDownThread<View>::TrackBinder(void* castToThis)
|
|||||||
MouseDownThread* self = static_cast<MouseDownThread*>(castToThis);
|
MouseDownThread* self = static_cast<MouseDownThread*>(castToThis);
|
||||||
self->Track();
|
self->Track();
|
||||||
// dead at this point
|
// dead at this point
|
||||||
TRESPASS();
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,9 +421,9 @@ MouseDownThread<View>::Track()
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete this;
|
delete this;
|
||||||
ASSERT(!"should not be here");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|
||||||
using namespace BPrivate;
|
using namespace BPrivate;
|
||||||
|
|||||||
Reference in New Issue
Block a user