On Wed, 17 Dec 2008, Guy K. Kloss wrote:

> Hi Hal and Bob,
> thanks for that info. It's a dirty workaround, and as it depends on 
> global variables it will always bear the problem of potential 
> failure in multi-threaded programs. Additionally, as I'm coding away 
> in Python I don't have those Dirty Old Tricks (TM) at hand, either.

I am not sure which of the solution you say is a dirty workaround and 
depends on global variables.  If you are using an object oriented 
language and lcms supports passing a pointer then you can pass the 
address of 'this' object and the callback function can then invoke a 
well known method name on the object so that the error is handled by 
the correct object. This avoids any use of a global variable.  The 
most common situation is to use the error info to decide if processing 
should be aborted, and then the object re-checks when lcms returns to 
see if an error was recorded and the user should be notified.

Bob
======================================
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to