I have this code in my class:

void KillWindow() { glutDestroyWindow(m_window); };

But evry time i execute it it gives a segmentation fault(only when i run it in a debugger).
And when i make m_window public in my class and then use
It prints a segmentation fault.
Is it my code that causes the segmentation fault or is it a bug in glut?
Thanks Hylke