Xlib Problem: XCloseDisplay seg fault


 
Thread Tools Search this Thread
Top Forums Programming Xlib Problem: XCloseDisplay seg fault
# 1  
Old 09-04-2008
Data Xlib Problem: XCloseDisplay seg fault

Hi,
First of all forgive me if Xlib related problems does not go under this thread.

In my main program, im using Xlib`s XImage type object which contains a regularly updating bitmap, and maps the XImage to a Xwindow using XPutImage.
( XCreateImage is used to create the XImage. )

The program also have another thread as the X-Event handler. there at an expose event, XPutImage is used to update the XWindow.

The XLib functions works fine and does the job, but the problems occurs when tried to exit the main, before exiting im calling the following functions in order to release the X-System resources taken.
Code:
	/* Destroy the XImage - de alloc memory */
	XDestroyImage( xImage );

	/* destroy specified window */
	XDestroyWindow( pDisplay, showWindow );
		
	/* disconnect from X server */
	XCloseDisplay( pDisplay );    -------> give a segmentation fault

When @ the XCloseDisplay( pDisplay ); function call it gives a segmentation fault.
I tried different solutions but never went right. can anybody have any comments on what im doing wrong here.
Thankx.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Debian

Linux, Debian - Segmentation Fault problem.

Hi guys, first of all apologize for my English... I have a big problem with "Segmentation fault", when running my game server. Console: (gdb) bt full #0 0x0000000000000000 in ?? () No symbol table info available. #1 0x00007ffff702aca4 in std::basic_ostream<char,... (1 Reply)
Discussion started by: Arson.
1 Replies

2. Shell Programming and Scripting

Find and split the list of files with suffiz of seg**

Hi,. I am writing a script to get the new files and split them. Requirement Find the new files under the path "/wload/scmp/app/data/OAS" (There are 5 sub folders). Gunzip the files which are having .gz suffix. Put the list of files in the filename in the format... (0 Replies)
Discussion started by: Satish Shettar
0 Replies

3. Programming

Using gdb, ignore beginning segmentation fault until reproduce environment segmentation fault

I use a binary name (ie polo) it gets some parameter , so for debugging normally i do this : i wrote script for watchdog my app (polo) and check every second if it's not running then start it , the problem is , if my app , remain in state of segmentation fault for a while (ie 15 ... (6 Replies)
Discussion started by: pooyair
6 Replies

4. Programming

'seg' assembly instruction in .s file

Is this x86? I encountered this instruction and can't seem to find any info on what it does anywhere. Any ideas? This is how it appears: seg es (4 Replies)
Discussion started by: stevenswj
4 Replies

5. Programming

Seg Fault Running AIX COBOL program

Hi some help read............ I'm getting a segmentation fault when I run an AIX COBOL/Db2 program. I initiate the program from the command line, but it hangs, and then when I press enter it generates a segmantation fault and produces a core dump. The box is running AIX software level ... (5 Replies)
Discussion started by: steve_f
5 Replies

6. HP-UX

HP-UX 64 compilation causing some code to seg fault

Hello everyone, Today we are attempting to port some legacy C code to a 64 HP-UX machine at my company and there is kind of a strange error we ran into. there is a small function they have defined called zgetenv that accepts a char* and basically just does some null checking and returns ... (0 Replies)
Discussion started by: khadesh
0 Replies

7. Programming

Open Suse 10 seg fault

Okay, so here is some code that when compiled on Fedora Core 6 works great, but when I compile and run it on OpenSuse 10 it gives back a seg fault when trying to join the 2nd thead. #include <pthread.h> #include <stdio.h> int print_message_function( void *ptr ); int x = 1; main() { ... (1 Reply)
Discussion started by: chrisdrobison
1 Replies
Login or Register to Ask a Question