This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

SEH & class with virtual method



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]