1
Mega Tokyo SCI Archive / Re:SCI Studio bug report
« on: March 28, 2003, 07:02:51 AM »
Brian,
I found a Delphi help-file on the web and since Delphi also uses the VCL I think most of it is applicable to the C++ components too.
The TCanvas class has a method called TryLock()
form the helpfile :
I hope this helps you a little bit...
One question : Do you use multi-threading in SCI Studio ? Because if you do, you must be very careful with locking and unlocking resources.
Jeroen
PS : here are some free memory- and resourceleak-checkers http://www.thefreecountry.com/sourcecode/debugging.shtml
I found a Delphi help-file on the web and since Delphi also uses the VCL I think most of it is applicable to the C++ components too.
The TCanvas class has a method called TryLock()
form the helpfile :
Quote
Locks the canvas if it is currently unlocked.
function TryLock: Boolean;
Description
Call TryLock to prevent other threads from writing on the surface of the canvas until the Unlock method is called. Unlike calls to the Lock method, which nest so that every call to Lock must be matched with a subsequent call to Unlock, TryLock need only be matched by a call to Unlock if the canvas was not already locked.
If the canvas is unlocked, TryLock locks the canvas, sets the LockCount property to 1, and returns True. If the canvas is already locked, TryLock returns False without making any changes.
Use TryLock before attempting changes to the canvas that could interfere with other code that is protected by a Lock ... Unlock pair of method calls.
I hope this helps you a little bit...
One question : Do you use multi-threading in SCI Studio ? Because if you do, you must be very careful with locking and unlocking resources.
Jeroen
PS : here are some free memory- and resourceleak-checkers http://www.thefreecountry.com/sourcecode/debugging.shtml


