This is the mail archive of the
pthreads-win32@sources.redhat.com
mailing list for the pthreas-win32 project.
SEH & class with virtual method
- To: pthreads-win32 at sourceware dot cygnus dot com
- Subject: SEH & class with virtual method
- From: Ales Pour <pour at princip dot cz>
- Date: Tue, 07 Aug 2001 15:02:56 +0200
- Organization: Princip a.s.
Hello,
I ran into the following problem: if I have a class with virtual method
and use pthread_cleanup_push/pop() macros, compilation with VC++ 5.0
(SP3) fails with
'error C2712: Cannot use __try in functions that require object
unwinding'.
Here's the code:
#define PtW32NoCatchWarn
#include "pthread.h"
class X {
virtual void x() {}
};
extern "C" {
extern void *thread(void *);
extern void *code(void *);
}
void *
cleanup(void *arg)
{
return NULL;
}
void *
code(void *arg)
{
X *xa3 = new X();
pthread_cleanup_push(thread,NULL);
pthread_cleanup_pop(1);
return NULL;
}
int
main()
{
code(NULL);
return EXIT_SUCCESS;
}
Thank you!
__________________
Ales Pour
Princip a.s. Praha
Czech Republic