mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Don't hold session pointer in Data::CloudImage.
This commit is contained in:
@@ -3030,17 +3030,18 @@ not_null<Data::CloudImage*> Session::location(const LocationPoint &point) {
|
||||
if (i != _locations.cend()) {
|
||||
return i->second.get();
|
||||
}
|
||||
const auto result = _locations.emplace(
|
||||
point,
|
||||
std::make_unique<Data::CloudImage>(_session)).first->second.get();
|
||||
const auto location = Data::ComputeLocation(point);
|
||||
result->set(ImageWithLocation{
|
||||
const auto prepared = ImageWithLocation{
|
||||
.location = ImageLocation(
|
||||
{ location },
|
||||
location.width,
|
||||
location.height)
|
||||
});
|
||||
return result;
|
||||
};
|
||||
return _locations.emplace(
|
||||
point,
|
||||
std::make_unique<Data::CloudImage>(
|
||||
_session,
|
||||
prepared)).first->second.get();
|
||||
}
|
||||
|
||||
void Session::registerPhotoItem(
|
||||
|
Reference in New Issue
Block a user