mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-09-26 19:29:06 +00:00
fix: crash on repeat disconnect
This commit is contained in:
parent
78cc026ddb
commit
4f12e13a7e
1 changed files with 5 additions and 2 deletions
|
@ -464,8 +464,11 @@ void Dialog::onDeviceConnected(bool success, const QString &serial, const QStrin
|
|||
void Dialog::onDeviceDisconnected(QString serial)
|
||||
{
|
||||
GroupController::instance().removeDevice(serial);
|
||||
|
||||
auto data = qsc::IDeviceManage::getInstance().getDevice(serial)->getUserData();
|
||||
auto device = qsc::IDeviceManage::getInstance().getDevice(serial);
|
||||
if (!device) {
|
||||
return;
|
||||
}
|
||||
auto data = device->getUserData();
|
||||
if (data) {
|
||||
VideoForm* vf = static_cast<VideoForm*>(data);
|
||||
qsc::IDeviceManage::getInstance().getDevice(serial)->deRegisterDeviceObserver(vf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue