[haiku-commits] haiku: hrev44497 - src/kits/tracker

  • From: stpere@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 8 Aug 2012 22:38:42 +0200 (CEST)

hrev44497 adds 1 changeset to branch 'master'
old head: 0bc1be3252ac6e87e2b046fb06f8d36425c23b51
new head: aafb6faf57de4b30be7bb10c5a70245498d7344a

----------------------------------------------------------------------------

aafb6fa: PoseView: crash related to PoseView containing many files
  
  Due to a previous change in the incrementation of models in AddPosesTask,
  PoseView containing large number of poses were prone to crash in ClearPoses().
  
  Gaps in PoseList or other invalid memory area were introduced.
  
  Thanks to x-ist for precious assistance in spotting those issues!

                                [ Philippe Saint-Pierre <stpere@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev44497
Commit:      aafb6faf57de4b30be7bb10c5a70245498d7344a
URL:         http://cgit.haiku-os.org/haiku/commit/?id=aafb6fa
Author:      Philippe Saint-Pierre <stpere@xxxxxxxxx>
Date:        Wed Aug  8 20:36:02 2012 UTC

----------------------------------------------------------------------------

1 file changed, 3 insertions(+), 1 deletion(-)
src/kits/tracker/PoseView.cpp |    4 +++-

----------------------------------------------------------------------------

diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp
index 40db53e..779947c 100644
--- a/src/kits/tracker/PoseView.cpp
+++ b/src/kits/tracker/PoseView.cpp
@@ -1394,6 +1394,7 @@ BPoseView::AddPosesTask(void* castToParams)
                                        PRINT(("1 adding model %s to zombie 
list, error %s\n",
                                                model->Name(), 
strerror(model->InitCheck())));
                                        view->fZombieList->AddItem(model);
+                                       modelChunkIndex--;
                                        continue;
                                }
 
@@ -1402,6 +1403,7 @@ BPoseView::AddPosesTask(void* castToParams)
 
                                if (!PoseVisible(model,
                                        
&(posesResult->fPoseInfos[modelChunkIndex]))) {
+                                       model->CloseNode();
                                        modelChunkIndex--;
                                        continue;
                                }
@@ -1414,7 +1416,7 @@ BPoseView::AddPosesTask(void* castToParams)
 
                        bigtime_t now = system_time();
 
-                       if (!count || modelChunkIndex >= kMaxAddPosesChunk
+                       if (!count || modelChunkIndex >= kMaxAddPosesChunk - 1
                                || now > nextChunkTime) {
                                // keep getting models until we get 
<kMaxAddPosesChunk> of them
                                // or until 300000 runs out


Other related posts:

  • » [haiku-commits] haiku: hrev44497 - src/kits/tracker - stpere