Mercurial > dwindows
comparison gtk3/dw.c @ 1886:f7d408a47752
Fix a couple of errors reported by the static analyzer on Mac....
Also added similar fixes to the other platforms as well just in case.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 05 Sep 2013 17:58:40 +0000 |
parents | 71780cf68aa2 |
children | 09860ba329a4 |
comparison
equal
deleted
inserted
replaced
1885:0768bbcf67e5 | 1886:f7d408a47752 |
---|---|
2056 void *dw_dialog_wait(DWDialog *dialog) | 2056 void *dw_dialog_wait(DWDialog *dialog) |
2057 { | 2057 { |
2058 void *tmp; | 2058 void *tmp; |
2059 int newprocess = 0; | 2059 int newprocess = 0; |
2060 | 2060 |
2061 if(!dialog) | |
2062 return NULL; | |
2063 | |
2061 /* _dw_thread will be -1 if dw_main hasn't been run yet. */ | 2064 /* _dw_thread will be -1 if dw_main hasn't been run yet. */ |
2062 if(_dw_thread == (pthread_t)-1) | 2065 if(_dw_thread == (pthread_t)-1) |
2063 { | 2066 { |
2064 _dw_thread = pthread_self(); | 2067 _dw_thread = pthread_self(); |
2065 newprocess = 1; | 2068 newprocess = 1; |
8030 | 8033 |
8031 FD_SET(array[z].fd, &rd); | 8034 FD_SET(array[z].fd, &rd); |
8032 } | 8035 } |
8033 | 8036 |
8034 if(select(maxfd+1, &rd, NULL, NULL, NULL) == -1) | 8037 if(select(maxfd+1, &rd, NULL, NULL, NULL) == -1) |
8038 { | |
8039 free(array); | |
8035 return; | 8040 return; |
8041 } | |
8036 | 8042 |
8037 if(FD_ISSET(listenfd, &rd)) | 8043 if(FD_ISSET(listenfd, &rd)) |
8038 { | 8044 { |
8039 struct _seminfo *newarray; | 8045 struct _seminfo *newarray; |
8040 int newfd = accept(listenfd, 0, 0); | 8046 int newfd = accept(listenfd, 0, 0); |
8041 | 8047 |
8042 if(newfd > -1) | 8048 if(newfd > -1) |
8043 { | 8049 { |
8044 /* Add new connections to the set */ | 8050 /* Add new connections to the set */ |
8045 newarray = (struct _seminfo *)malloc(sizeof(struct _seminfo)*(connectcount+1)); | 8051 newarray = (struct _seminfo *)malloc(sizeof(struct _seminfo)*(connectcount+1)); |