jirentabu / crashrpt

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

Install/uninstall exception handlers automatically in DllMain() on DLL_THREAD_ATTACH/DETACH #185

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am trying to crowbar in the latest CrashRpt into a vast project that last 
used some 7 year old variant of it which did not call the install/uninstall 
functions for each thread as is recommended now.  At first I thought to make a 
simple RAII type class which has install as constructor and uninstall as 
destructor and simply declare a volatile instance of this class at the start of 
each thread function however it was told to me perhaps a better option is to 
create a DLL wrapping the CrashRpt interface and then having the DllMain call 
out the InstallThread/UnInstall functions upon DLL_THREAD_ATTACH/DETACH cases.  
This way it will automatically call these functions for every thread including 
even the 3rd party library threads we link in which we have no source code for. 

Original issue reported on code.google.com by zexspect...@gmail.com on 15 Feb 2013 at 2:39

GoogleCodeExporter commented 9 years ago
perhaps the best way to handle this is to have a simple option specified in 
crInstall() which allows the user to enable automatic thread installation or 
not.  A simple config flag that activates these calls in the CrashRpt DLL 
directly.  Then you can enable it by default and the tricky people who think 
they know better can disable it and do as they wish.  My guess is most people 
don't want to worry about it, especially linking in 3rd party libs where they 
have no control over.

Original comment by zexspect...@gmail.com on 15 Feb 2013 at 3:25

GoogleCodeExporter commented 9 years ago
Looking forward to this!

Original comment by dfort...@kaneva.com on 15 Feb 2013 at 3:26

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1590.

Original comment by zexspect...@gmail.com on 4 Apr 2013 at 2:50