Mercurial > dwindows
comparison mac/dw.m @ 727:f190b5c2ce16
Fixed 2 errors in the tree select event handler. Also removed unused experimental code.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 14 Mar 2011 21:43:28 +0000 |
parents | ecf47778caff |
children | 55f22b39ab57 |
comparison
equal
deleted
inserted
replaced
726:ecf47778caff | 727:f190b5c2ce16 |
---|---|
277 if([object isKindOfClass:[NSOutlineView class]]) | 277 if([object isKindOfClass:[NSOutlineView class]]) |
278 { | 278 { |
279 item = (id)event; | 279 item = (id)event; |
280 NSString *nstr = [item pointerAtIndex:1]; | 280 NSString *nstr = [item pointerAtIndex:1]; |
281 | 281 |
282 user = [item pointerAtIndex:3]; | 282 if(nstr) |
283 if(user) | |
284 { | 283 { |
285 text = strdup([nstr UTF8String]); | 284 text = strdup([nstr UTF8String]); |
286 } | 285 } |
287 else | 286 else |
288 { | 287 { |
289 text = NULL; | 288 text = NULL; |
290 } | 289 } |
290 user = [item pointerAtIndex:2]; | |
291 int result = treeselectfunc(handler->window, item, text, handler->data, user); | 291 int result = treeselectfunc(handler->window, item, text, handler->data, user); |
292 if(text) | 292 if(text) |
293 { | 293 { |
294 free(text); | 294 free(text); |
295 } | 295 } |
6753 * Returns the handle to an unnamed mutex semaphore. | 6753 * Returns the handle to an unnamed mutex semaphore. |
6754 */ | 6754 */ |
6755 HMTX dw_mutex_new(void) | 6755 HMTX dw_mutex_new(void) |
6756 { | 6756 { |
6757 HMTX mutex = malloc(sizeof(pthread_mutex_t)); | 6757 HMTX mutex = malloc(sizeof(pthread_mutex_t)); |
6758 #if 0 | 6758 |
6759 pthread_mutexattr_t attr; | |
6760 | |
6761 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); | |
6762 pthread_mutex_init(mutex, &attr); | |
6763 #endif | |
6764 pthread_mutex_init(mutex, NULL); | 6759 pthread_mutex_init(mutex, NULL); |
6765 return mutex; | 6760 return mutex; |
6766 } | 6761 } |
6767 | 6762 |
6768 /* | 6763 /* |