mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-11-29 18:59:14 +08:00
drawablecontainer's code format and memleak
This commit is contained in:
parent
9f82cec89a
commit
f09a0c1a0b
@ -161,6 +161,7 @@ void DrawableContainer::DrawableContainerState::createAllFutures(){
|
||||
for (int keyIndex = 0; keyIndex < futureCount; keyIndex++) {
|
||||
const int index= mDrawableFutures.keyAt(keyIndex);
|
||||
std::shared_ptr<ConstantState>cs =mDrawableFutures.valueAt(keyIndex);
|
||||
delete mDrawables[index];
|
||||
mDrawables[index] = prepareDrawable(cs->newDrawable());
|
||||
}
|
||||
mDrawableFutures.clear();
|
||||
|
@ -38,8 +38,8 @@ protected:
|
||||
int mTintMode;
|
||||
ColorFilter*mColorFilter;
|
||||
const ColorStateList*mTintList;
|
||||
std::vector<Drawable* >mDrawables;
|
||||
SparseArray<std::shared_ptr<ConstantState> >mDrawableFutures;
|
||||
std::vector<Drawable*>mDrawables;
|
||||
SparseArray<std::shared_ptr<ConstantState>>mDrawableFutures;
|
||||
DrawableContainerState(const DrawableContainerState*orig,DrawableContainer*own);
|
||||
~DrawableContainerState()override;
|
||||
DrawableContainer*newDrawable()override{return nullptr;}//must be overrided by inherited
|
||||
|
Loading…
Reference in New Issue
Block a user