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:
parent
989addc209
commit
8373bcd169
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user