StdSchedulerMac: Was crashy because of faulty memory management which is now hopefully better

stable-5.4
Martin Plicht 2014-01-29 22:57:19 +01:00
parent b6083f0e9f
commit b76b4342aa
1 changed files with 7 additions and 3 deletions

View File

@ -46,7 +46,7 @@ using namespace std;
- (SCHAddition*) assignAdditionForProc:(StdSchedulerProc*) proc;
+ (SCHAdditions*) requestAdditionForScheduler:(StdScheduler*) scheduler;
- (BOOL) removeAdditionForProc:(StdSchedulerProc*) proc;
@property(readonly) NSRunLoop* runLoop;
@property(readonly) __weak NSRunLoop* runLoop;
@property(readonly) StdScheduler* scheduler;
@end
@ -197,8 +197,12 @@ void callback (CFSocketRef s, CFSocketCallBackType type, CFDataRef address, cons
[super registerAt:_additions];
vector<struct pollfd> vecs;
proc->GetFDs(vecs);
CFSocketContext ctx = {};
ctx.info = (__bridge void*)self;
CFSocketContext ctx =
{
.info = (__bridge void*)self,
.retain = CFRetain,
.release = CFRelease
};
for (auto p : vecs)
{
auto socket = CFSocketCreateWithNative(NULL,