- client: fix crashing bug when detach from project.

The problem: the variable ordered_scheduled_results
    has a list of pointers to RESULTs.
    These pointers become dangling when the project is detached.
    It's not sufficient to do schedule_cpus() because this returns
    immediately if # projects == 0.
    So clear the list directly.
    Rom: please port to 6.2

svn path=/trunk/boinc/; revision=15407
This commit is contained in:
David Anderson 2008-06-16 16:52:17 +00:00
parent b16fb12329
commit ccc92976e9
2 changed files with 19 additions and 2 deletions

View File

@ -4874,3 +4874,16 @@ David 14 June 2008
clientgui/
WelcomePage.cpp,h
BOINCWizards.h
David 16 June 2008
- client: fix crashing bug when detach from project.
The problem: the variable ordered_scheduled_results
has a list of pointers to RESULTs.
These pointers become dangling when the project is detached.
It's not sufficient to do schedule_cpus() because this returns
immediately if # projects == 0.
So clear the list directly.
Rom: please port to 6.2
client/
client_state.C

View File

@ -1407,8 +1407,12 @@ int CLIENT_STATE::reset_project(PROJECT* project, bool detaching) {
garbage_collect_always();
// forcibly remove apps and app_versions
// (but not if anonymous platform)
// "ordered_scheduled_results" may contain pointers (now dangling)
// to tasks of this project.
//
ordered_scheduled_results.clear();
// remove apps and app_versions (but not if anonymous platform)
//
if (!project->anonymous_platform || detaching) {
avp_iter = app_versions.begin();