nanogui: Segmentation Fault
Subject:
Segmentation fault
From:
"rajan Singh" ####@####.####
Date:
23 May 2006 13:26:04 +0100
Message-Id: <7afad4a10605230525k32feb47ai2cbf210a03d8a7a5@mail.gmail.com>
the following code is generating Segmentation fault at the nano-x server,
please help.
The Fault occurs at GrReadArea(...)
size_t nDataSize = 0;
GrGetWindowInfo(GR_ROOT_WINDOW_ID, &info);
nDataSize = sizeof(GR_PIXELVAL) * info.width * info.height;
data = reinterpret_cast<GR_PIXELVAL*>(new char[nDataSize]);
if (data == NULL)
{
cout << "failed to malloc mem for buffer\n";
}
// Fault occurs here
GrReadArea(GR_ROOT_WINDOW_ID, info.x, info.y, info.width,
info.height, data);
--
Rajan Singh Raghuvanshi