[SDL] Re: Trying to pass an SDL_Surface to an object constructor
Nick
csucew at dcs.warwick.ac.uk
Tue Aug 17 09:28:57 PDT 2004
Stephane Marchesin <stephane.marchesin <at> wanadoo.fr> writes:
> >>Nick wrote:
> >>
> >>>Doing this compiles, but gives a seg fault when
> >>>the Painter class tries to use this
> >>>pointer.
> >
> My guess is that Painter::~Painter contains a SDL_FreeSurface(s),
> right ?
>
> Stephane
No, I haven't put anything in the destructor as yet, but
that shouldn't matter because I'm not destroying the Painter,
it doesn't make a difference if I do that.
I don't release the original pointer, I just pass it to the
constructor of this Painter class, which assigns it to a
pointer in the class, which should hopefully make it point
to the same surface? Is that correct?
Thanks
Nick
More information about the SDL
mailing list