File tree Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -161,9 +161,10 @@ private static void GetCursorState()
161
161
if ( GetCursorInfo ( out pci ) )
162
162
{
163
163
IntPtr htcursor = pci . hCursor ;
164
- Cursor micursor = null ;
165
- micursor = new Cursor ( htcursor ) ;
166
- Tipo = micursor . ToString ( ) ;
164
+ using ( var micursor = new Cursor ( htcursor ) )
165
+ {
166
+ Tipo = micursor . ToString ( ) ;
167
+ }
167
168
}
168
169
}
169
170
catch // (Exception ex)
Original file line number Diff line number Diff line change @@ -370,9 +370,10 @@ private void WorkerThread( )
370
370
catch ( Exception exception )
371
371
{
372
372
// provide information to clients
373
- if ( VideoSourceError != null )
373
+ VideoSourceErrorEventHandler videoSrcHandler = VideoSourceError ;
374
+ if ( videoSrcHandler != null )
374
375
{
375
- VideoSourceError ( this , new VideoSourceErrorEventArgs ( exception . Message ) ) ;
376
+ videoSrcHandler ( this , new VideoSourceErrorEventArgs ( exception . Message ) ) ;
376
377
}
377
378
// wait for a while before the next try
378
379
Thread . Sleep ( 250 ) ;
@@ -387,9 +388,10 @@ private void WorkerThread( )
387
388
graphics . Dispose ( ) ;
388
389
bitmap . Dispose ( ) ;
389
390
390
- if ( PlayingFinished != null )
391
+ PlayingFinishedEventHandler handler = PlayingFinished ;
392
+ if ( handler != null )
391
393
{
392
- PlayingFinished ( this , ReasonToFinishPlaying . StoppedByUser ) ;
394
+ handler ( this , ReasonToFinishPlaying . StoppedByUser ) ;
393
395
}
394
396
}
395
397
}
Original file line number Diff line number Diff line change @@ -735,7 +735,7 @@ static void worker(object param)
735
735
ulong ctime = currtime - 100000 * Timer . getCPUFrequency ( ) ;
736
736
for ( int i = 0 ; i < self . m_pRcvUList . m_nodeList . Count ; ++ i )
737
737
{
738
- RNode ul = self . m_pRcvUList . m_nodeList [ 0 ] ;
738
+ RNode ul = self . m_pRcvUList . m_nodeList [ i ] ;
739
739
if ( ul . m_llTimeStamp >= ctime )
740
740
break ;
741
741
Original file line number Diff line number Diff line change @@ -67,8 +67,6 @@ public UdtSocket Accept()
67
67
{
68
68
IPEndPoint clientEndPoint = null ;
69
69
int clientSocketId = UDT . s_UDTUnited . accept ( mSocketId , ref clientEndPoint ) ;
70
- if ( clientSocketId == UDT . INVALID_SOCK )
71
- return null ;
72
70
73
71
return new UdtSocket ( clientSocketId , clientEndPoint , mLocalEndPoint ) ;
74
72
}
You can’t perform that action at this time.
0 commit comments