EldoS | Feel safer!

Software components for data protection, secure storage and transfer

conflict between Unmount and System.Windows.Application.Current.Dispat

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
Posted: 09/17/2012 08:51:39
by ttran Tran (Priority Standard support level)
Joined: 08/20/2012
Posts: 35

In CBFS part, inside CbFsCloseFile we have a code to update GUI as following:

System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (System.Threading.ThreadStart)delegate

                Code for update GUI


OK, whenever we invoke myCbFs.unmount() during the uploading files process (it means CbFsCloseFile occurs), we discover that the application is always freezing at the GUI Thread above. Is that true that Unmount also access screen ?
What is the safe strategy to get rid of this freezing situation ?

Posted: 09/17/2012 09:17:11
by Eugene Mayevski (Team)

You should not do any UI operations in callback. The general rule is the less you do in callbacks, the better. You need to post an asynchronous notification to another thread (including main thread) which would handle the notification and update the UI.

Sincerely yours
Eugene Mayevski
Posted: 09/18/2012 13:16:19
by ttran Tran (Priority Standard support level)
Joined: 08/20/2012
Posts: 35

Thanks - valuable advice



Topic viewed 1153 times



Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!