gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] gnash ChangeLog extensions/fileio/fileio.cpp


From: Bastiaan Jacques
Subject: Re: [Gnash-commit] gnash ChangeLog extensions/fileio/fileio.cpp
Date: Fri, 23 Feb 2007 14:28:48 +0100 (CET)



On Thu, 22 Feb 2007, Udo Giacomozzi wrote:

Thursday, February 22, 2007, 2:23:29 PM, I wrote:
UG> -    string str = ptr->fgets(str);
UG> +    string str;
UG> +    str = ptr->fgets(str);

Don't really know why this patch was necessary, but I got always
segementation faults when the function returned...

AFAIK:

The string object hasn't finished construction yet when it is used in the call to ptr->fgets(). This could be in part due to the compiler optimising

string str = ptr->fgets(str);

to

string str (ptr->fgets(str));

And therefore, a pointer to the object that isn't yet completely initialised is used and this crashes.

Bastiaan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]