mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Fix several possible crashes.
This commit is contained in:
@@ -522,9 +522,23 @@ not_null<Ui::SlideWrap<>*> Controller::addRequestedListBlock(
|
||||
lt_count_decimal,
|
||||
std::move(requestedCount)));
|
||||
|
||||
const auto delegate = container->lifetime().make_state<
|
||||
PeerListContentDelegateSimple
|
||||
>();
|
||||
class Delegate final : public PeerListContentDelegateSimple {
|
||||
public:
|
||||
explicit Delegate(std::shared_ptr<Main::SessionShow> show)
|
||||
: _show(std::move(show)) {
|
||||
}
|
||||
|
||||
std::shared_ptr<Main::SessionShow> peerListUiShow() override {
|
||||
return _show;
|
||||
}
|
||||
|
||||
private:
|
||||
const std::shared_ptr<Main::SessionShow> _show;
|
||||
|
||||
};
|
||||
const auto delegate = container->lifetime().make_state<Delegate>(
|
||||
this->delegate()->peerListUiShow());
|
||||
|
||||
const auto controller = container->lifetime().make_state<
|
||||
Controller
|
||||
>(_peer, _data.current().admin, _data.value(), Role::Requested);
|
||||
|
||||
@@ -936,16 +936,18 @@ void ShareBox::Inner::loadProfilePhotos() {
|
||||
const auto from = std::max(yFrom / _rowHeight, 0);
|
||||
const auto to = std::max((yTo / _rowHeight) + 1, from);
|
||||
|
||||
const auto ffrom = from;
|
||||
const auto fto = std::min(to, int(_filtered.size()));
|
||||
const auto ffrom = std::min(from, fto);
|
||||
for (auto i = ffrom; i != fto; ++i) {
|
||||
preloadUserpic(_filtered[i]->entry());
|
||||
}
|
||||
|
||||
const auto ufrom = std::max(from - int(_filtered.size()), 0);
|
||||
const auto uto = std::min(
|
||||
to - int(_filtered.size()),
|
||||
int(d_byUsernameFiltered.size()));
|
||||
const auto ufrom = std::min(
|
||||
std::max(from - int(_filtered.size()), 0),
|
||||
uto);
|
||||
for (auto i = ufrom; i != uto; ++i) {
|
||||
preloadUserpic(d_byUsernameFiltered[i]->history);
|
||||
}
|
||||
|
||||
+1
-1
Submodule Telegram/lib_ui updated: 30b22ace0b...a2c2d92cda
Reference in New Issue
Block a user