rzel / xar

Automatically exported from code.google.com/p/xar
0 stars 0 forks source link

xar_register_errhandler's usrctx gets set to NULL when a new error is raised #83

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Register an error handler using xar_register_errhandler(x, callback, 
some_custom_context)
2. xar_extract_tofile to a folder that is read only
3. the registered callback gets called with the error

What is the expected output? What do you see instead?
I'd expect the "some_custom_context" to be passed as the err_handler's usrctx 
parameter, but I keep getting nil. 

What version of the product are you using? On what operating system?
OS X Lion + XAR 1.5.2 from the Download's tarball. 

Please provide any additional information below.

The issue happens because the usrctx is stored within the errctx struct and 
when an error is reported xar_err_new is called which memsets errctx thus 
removing the context. I would have expected the usrctx to be stored in the same 
struct as the callback which would fix this issue.

I need this so that the error handler will call my ObjC wrapper. 

Original issue reported on code.google.com by bertra...@gmail.com on 5 Mar 2012 at 8:43