mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
clean containers when relogging
This commit is contained in:
@@ -123,6 +123,8 @@ void Connection::write(uint8* buffer, uint16 size)
|
||||
|
||||
if(!m_sendEvent || m_sendEvent->isExecuted() || m_sendEvent->isCanceled()) {
|
||||
auto weakSelf = ConnectionWeakPtr(shared_from_this());
|
||||
|
||||
// wait 1 ms to do the real send
|
||||
m_sendEvent = g_eventDispatcher.scheduleEvent([=] {
|
||||
if(!weakSelf.lock())
|
||||
return;
|
||||
|
@@ -107,6 +107,12 @@ void Protocol::internalRecvHeader(uint8* buffer, uint16 size)
|
||||
|
||||
void Protocol::internalRecvData(uint8* buffer, uint16 size)
|
||||
{
|
||||
// process data only if really connected
|
||||
if(!isConnected()) {
|
||||
logTraceError("received data while disconnected");
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(m_inputMessage.getBuffer() + InputMessage::CHECKSUM_POS, buffer, size);
|
||||
|
||||
if(m_checksumEnabled) {
|
||||
|
@@ -1300,10 +1300,10 @@ void UIWidget::onGeometryChange(const Rect& oldRect, const Rect& newRect)
|
||||
updateText();
|
||||
|
||||
// move children that is outside the parent rect to inside again
|
||||
//for(const UIWidgetPtr& child : m_children) {
|
||||
//if(!child->isAnchored())
|
||||
//child->bindRectToParent();
|
||||
//}
|
||||
for(const UIWidgetPtr& child : m_children) {
|
||||
if(!child->isAnchored())
|
||||
child->bindRectToParent();
|
||||
}
|
||||
}
|
||||
|
||||
void UIWidget::onLayoutUpdate()
|
||||
|
Reference in New Issue
Block a user