1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-06 03:50:19 +02:00

fixed shared_ptr issue

This commit is contained in:
Nikolay Pultsin 2014-10-12 02:28:21 +02:00
parent 4de9d69bc0
commit 31c69f7ba7
2 changed files with 7 additions and 3 deletions

View file

@ -270,8 +270,7 @@ void StyleSheetMultiStyleParser::storeData(const std::string &selector, const St
ZLLogger::Instance().println("CSS-SELECTOR", "SELE = '" + selector->Tag + "." + selector->Class + "'");
store(selector, map);
while (!selector->Next.isNull()) {
shared_ptr<CSSSelector> s = selector->Next->Selector;
selector = s;
selector = selector->Next->Selector;
ZLLogger::Instance().println("CSS-SELECTOR", "SUB SELE = '" + selector->Tag + "." + selector->Class + "'");
}
}

View file

@ -216,17 +216,22 @@ inline const shared_ptr<T> &shared_ptr<T>::operator = (T *t) {
template<class T>
inline const shared_ptr<T> &shared_ptr<T>::operator = (const shared_ptr<T> &t) {
if (&t != this) {
t.myStorage->addReference();
detachStorage();
attachStorage(t.myStorage);
t.myStorage->removeReference();
}
return *this;
}
template<class T>
inline const shared_ptr<T> &shared_ptr<T>::operator = (const weak_ptr<T> &t) {
detachStorage();
if (!t.isNull()) {
t.myStorage->addReference();
detachStorage();
attachStorage(t.myStorage);
t.myStorage->removeReference();
} else {
detachStorage();
attachStorage(0);
}
return *this;