Name::Index(): Fix initialization order

Add the node listener directly after calling the base class Init().
Otherwise, on error, the we could try to remove the listener although it
wasn't added in the first place.
This commit is contained in:
Ingo Weinhold
2011-07-17 16:55:04 +02:00
parent 32ad4ceefb
commit 49d2f608d4
@@ -148,13 +148,12 @@ NameIndex::Init(Volume* volume)
if (error != B_OK)
return error;
fVolume->AddNodeListener(this, NULL);
fEntries = new(std::nothrow) EntryTree;
if (fEntries == NULL)
return B_NO_MEMORY;
fVolume = volume;
fVolume->AddNodeListener(this, NULL);
return B_OK;
}