Move NSAutoreleasePool handling into the proper entry/exit points

for the real wiimote thread as for the other threads.

Turns out we use OS X bluetooth API's that were introduced in 10.5.4.
 
Remove vestiges of previously removed wiiuse_set_bluetooth_stack().

XXX We should probably have a Common equivalent of htonl and friends.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6531 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2010-12-05 16:18:09 +00:00
parent 5910ef259c
commit 4934cd29b3
6 changed files with 27 additions and 43 deletions

View File

@ -34,10 +34,7 @@
#import <CoreServices/CoreServices.h>
extern "C" OSErr UpdateSystemActivity(UInt8 activity);
#define BLUETOOTH_VERSION_USE_CURRENT
#import <IOBluetooth/objc/IOBluetoothDevice.h>
#import <IOBluetooth/objc/IOBluetoothDeviceInquiry.h>
#import <IOBluetooth/objc/IOBluetoothHostController.h>
#import <IOBluetooth/objc/IOBluetoothL2CAPChannel.h>
#import <IOBluetooth/IOBluetooth.h>
#include "Common.h"
#include "wiiuse_internal.h"
@ -116,7 +113,7 @@ volatile int reader, writer, outstanding, watermark;
CFRunLoopStop(CFRunLoopGetCurrent());
UpdateSystemActivity(1);
(void)UpdateSystemActivity(1);
}
- (void) l2capChannelClosed: (IOBluetoothL2CAPChannel *) l2capChannel
@ -151,7 +148,6 @@ volatile int reader, writer, outstanding, watermark;
*/
int wiiuse_find(struct wiimote_t **wm, int max_wiimotes, int timeout)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
IOBluetoothHostController *bth;
IOBluetoothDeviceInquiry *bti;
SearchBT *sbt;
@ -199,7 +195,6 @@ int wiiuse_find(struct wiimote_t **wm, int max_wiimotes, int timeout)
[bth release];
[bti release];
[sbt release];
[pool release];
return found_devices;
}
@ -247,7 +242,6 @@ int wiiuse_connect(struct wiimote_t **wm, int wiimotes)
*/
static int wiiuse_connect_single(struct wiimote_t *wm, char *address)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
ConnectBT *cbt = [[ConnectBT alloc] init];
if (wm == NULL || WIIMOTE_IS_CONNECTED(wm))
@ -268,7 +262,6 @@ static int wiiuse_connect_single(struct wiimote_t *wm, char *address)
wiiuse_set_report_type(wm);
[cbt release];
[pool release];
return 1;
}
@ -284,8 +277,6 @@ static int wiiuse_connect_single(struct wiimote_t *wm, char *address)
*/
void wiiuse_disconnect(struct wiimote_t *wm)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (wm == NULL)
return;
@ -297,7 +288,6 @@ void wiiuse_disconnect(struct wiimote_t *wm)
[cchan closeChannel];
[ichan closeChannel];
[btd closeConnection];
[pool release];
}
int wiiuse_io_read(struct wiimote_t *wm)