| View previous topic :: View next topic |
| Author |
Message |
sturatt
Joined: 13 Jul 2006 Posts: 46
|
Posted: Fri Aug 04, 2006 3:39 pm Post subject: function stops app from exiting correctly [Resolved] |
|
|
This is pretty weird, if i dont call this function, my app closes fine, but when i do, it freezes on exit... i dont get it
| Code: |
void openPl()
{
printf("Test\n");
sceKernelDelayThread(1000000);
struct SceIoDirent plst;
int fd = sceIoDopen("./pl/");
printf("Test2\n");
sceKernelDelayThread(1000000);
printf("sceIoDopen worked\n");
sceKernelDelayThread(1000000);
char pl_array[50][100];
int pl_counter = 0;
int pl_low = 0;
int pl_high = 12;
int pl_selected = 0;
int pl_temp;
int pl_x = 95, pl_y = 82;
printf("initialization worked\n");
if (fd >= 0)
{
printf("fd = %i\n", fd);
sceKernelDelayThread(1000000);
sceIoDread(fd, &plst);
printf("%s\n", plst.d_name);
sceKernelDelayThread(1000000);
}
sceIoDclose(fd);
} |
commenting out the sceIoDread solves the problem. I'm using sceIoDread and sceIoDopen in other parts of the program... why is it being fussy here?
Last edited by sturatt on Sat Aug 05, 2006 1:46 am; edited 1 time in total |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
Posted: Fri Aug 04, 2006 5:19 pm Post subject: |
|
|
Try adding
memset(&plst, 0, sizeof plst);
That sometimes helps.
Jim _________________ http://www.dbfinteractive.com |
|
| Back to top |
|
 |
sturatt
Joined: 13 Jul 2006 Posts: 46
|
Posted: Sat Aug 05, 2006 1:11 am Post subject: |
|
|
| turns out that memset was all it needed.. any idea why? |
|
| Back to top |
|
 |
Drakonite Site Admin

Joined: 17 Jan 2004 Posts: 989
|
Posted: Sat Aug 05, 2006 1:36 am Post subject: |
|
|
A bug in Sony's code. _________________ Shoot Pixels Not People!
Makeshift Development |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Sat Aug 05, 2006 12:34 pm Post subject: |
|
|
| Unless you have a particular reason not to, I'd suggest sticking with newlib functions like opendir() readdir() etc. because we've already found and worked around these sort of issues. |
|
| Back to top |
|
 |
|