From c3ce629473721435c71ade4339b6c2099a2fbd2a Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Fri, 23 Oct 2009 08:07:56 +0000 Subject: [PATCH] * When a file was created, then deleted shortly after, on a PoseView that is busy processing other things, the file could be gone by the time we processed the fs notification message of the entry creation. This case wasn't handled properly and would cause #4130 and most certainly duplicate #4831, #4610 and also possibly #4271. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33744 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/PoseView.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index 0d4d2bdfb5..69f6ba063f 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -5080,7 +5080,13 @@ BPoseView::EntryCreated(const node_ref *dirNode, const node_ref *itemNode, // have to node monitor ahead of time because Model will // cache up the file type and preferred app Model *model = new Model(dirNode, itemNode, name, true); - if (model->InitCheck() != B_OK) { + + if (model->InitCheck() == B_ENTRY_NOT_FOUND) { + // might happen if the file was deleted shortly after creation and we + // were too busy to create the model in time see #4130 + delete model; + return NULL; + } else if (model->InitCheck() != B_OK) { // if we have trouble setting up model then we stuff it into // a zombie list in a half-alive state until we can properly awaken it PRINT(("2 adding model %s to zombie list, error %s\n", model->Name(),