* SEH & class with virtual method
@ 2001-08-07 6:02 Ales Pour
2001-08-07 6:54 ` Ales Pour
0 siblings, 1 reply; 2+ messages in thread
From: Ales Pour @ 2001-08-07 6:02 UTC (permalink / raw)
To: pthreads-win32
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: SEH & class with virtual method
2001-08-07 6:02 SEH & class with virtual method Ales Pour
@ 2001-08-07 6:54 ` Ales Pour
0 siblings, 0 replies; 2+ messages in thread
From: Ales Pour @ 2001-08-07 6:54 UTC (permalink / raw)
To: pthreads-win32
OK, don't bother; I moved allocation of instance of X out of a block
where pthread_cleanup_push/pop where used.
Thanks.
Ales Pour
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-08-07 6:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-07 6:02 SEH & class with virtual method Ales Pour
2001-08-07 6:54 ` Ales Pour
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).