From 7d33b63d40cb8ecbce52a065698e3b7131e0a77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 5 Apr 2009 21:22:14 +0000 Subject: [PATCH] * Fixed removing a per CPU source. * Fixed drawing problem when adding a new source, and the draw happened before a new value came in. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29951 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/activitymonitor/ActivityView.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/apps/activitymonitor/ActivityView.cpp b/src/apps/activitymonitor/ActivityView.cpp index a05589d8a2..d86deea61d 100644 --- a/src/apps/activitymonitor/ActivityView.cpp +++ b/src/apps/activitymonitor/ActivityView.cpp @@ -229,14 +229,16 @@ ViewHistory::Update(DataHistory* history, int32 width, int32 resolution, || fResolution != resolution || fRefresh != refresh) { fValues.SetSize(width); - fLastTime = 0; fResolution = resolution; fRefresh = refresh; + fLastTime = 0; } // Compute how many new values we need to retrieve if (fLastTime < history->Start()) fLastTime = history->Start(); + if (fLastTime > history->End()) + return; int32 updateWidth = int32((toTime - fLastTime) / step); if (updateWidth < 1) @@ -827,7 +829,6 @@ ActivityView::RemoveDataSource(const DataSource* remove) while (true) { DataSource* source = FindDataSource(remove); - //debug_printf("SEARCH %s, found %p\n", remove->Name(), source); if (source == NULL) { if (removed) break; @@ -1116,7 +1117,7 @@ ActivityView::MessageReceived(BMessage* message) if (source == NULL) AddDataSource(baseSource); else - RemoveDataSource(source); + RemoveDataSource(baseSource); Invalidate(); break;