Skip to content

Commit dbe8fcc

Browse files
committed
Remove extra class retain.
1 parent b864680 commit dbe8fcc

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

IntelBluetoothFirmware/BtIntel.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,15 @@ initWithDevice(IOService *client, IOUSBHostDevice *dev)
2727

2828
m_pUSBDeviceController = new USBDeviceController();
2929
if (!m_pUSBDeviceController->init(client, dev)) {
30-
OSSafeReleaseNULL(m_pUSBDeviceController);
3130
return false;
3231
}
3332
if (!m_pUSBDeviceController->initConfiguration()) {
34-
OSSafeReleaseNULL(m_pUSBDeviceController);
3533
return false;
3634
}
3735
if (!m_pUSBDeviceController->findInterface()) {
38-
OSSafeReleaseNULL(m_pUSBDeviceController);
3936
return false;
4037
}
4138
if (!m_pUSBDeviceController->findPipes()) {
42-
OSSafeReleaseNULL(m_pUSBDeviceController);
4339
return false;
4440
}
4541
return true;

IntelBluetoothFirmware/IntelBluetoothFirmware.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ bool IntelBluetoothFirmware::start(IOService *provider)
6666
return false;
6767
}
6868

69-
m_pDevice->retain();
7069
if (!m_pDevice->open(this)) {
7170
XYLog("start fail, can not open device\n");
7271
cleanUp();
@@ -118,7 +117,7 @@ void IntelBluetoothFirmware::cleanUp()
118117
if (m_pDevice->isOpen(this)) {
119118
m_pDevice->close(this);
120119
}
121-
OSSafeReleaseNULL(m_pDevice);
120+
m_pDevice = NULL;
122121
}
123122
}
124123

IntelBluetoothFirmware/USBDeviceController.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ init(IOService *client, IOUSBHostDevice *dev)
3535

3636
mReadBuffer->prepare(kIODirectionIn);
3737
m_pDevice = dev;
38-
m_pDevice->retain();
3938
m_pClient = client;
40-
m_pClient->retain();
4139
return true;
4240
}
4341

@@ -63,7 +61,6 @@ findInterface()
6361
if (m_pInterface == NULL) {
6462
return false;
6563
}
66-
m_pInterface->retain();
6764
if (!m_pInterface->open(m_pClient)) {
6865
XYLog("can not open interface\n");
6966
return false;
@@ -96,13 +93,13 @@ free()
9693
_hciLock = NULL;
9794
}
9895
if (m_pInterface) {
99-
if (m_pInterface->isOpen(m_pClient)) {
96+
if (m_pClient && m_pInterface->isOpen(m_pClient)) {
10097
m_pInterface->close(m_pClient);
98+
m_pClient = NULL;
10199
}
102-
OSSafeReleaseNULL(m_pInterface);
100+
m_pInterface = NULL;
103101
}
104-
OSSafeReleaseNULL(m_pDevice);
105-
OSSafeReleaseNULL(m_pClient);
102+
m_pDevice = NULL;
106103
super::free();
107104
}
108105

0 commit comments

Comments
 (0)