Make the state attribute private
Also add a virtual setState() method to give subclasses a chance to intercept the change of state. This will be used by VectorTileData to release resources when the TileData becomes immutable.
This commit is contained in:
committed by
Konstantin Käfer
parent
40b604448f
commit
41d619771e
@@ -15,14 +15,14 @@ RasterTileData::~RasterTileData() {
|
||||
}
|
||||
|
||||
void RasterTileData::parse() {
|
||||
if (state != State::loaded) {
|
||||
if (getState() != State::loaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (bucket.setImage(data)) {
|
||||
state = State::parsed;
|
||||
setState(State::parsed);
|
||||
} else {
|
||||
state = State::invalid;
|
||||
setState(State::invalid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user