Connecting Tech Pros Worldwide Help | Site Map

Re: newbie -- smart pointer destructor called without destructorever being called

Jimmy Hartzell
Guest
 
Posts: n/a
#1: Jun 27 '08
Specifically this function:
void fill_all(GCReference<GCTestwhat_with) {
for(int i = 0; i < 16; i++) {
refs[i] = what_with;
}
}

Some destructor seems to be getting called within this function, on an
improperly constructed object, in the body of the loop (at the end of
it). Why would that be?
Jimmy Hartzell
Guest
 
Posts: n/a
#2: Jun 27 '08

re: Re: newbie -- smart pointer destructor called without destructorever being called


Jimmy Hartzell wrote:
Quote:
Specifically this function:
void fill_all(GCReference<GCTestwhat_with) {
for(int i = 0; i < 16; i++) {
refs[i] = what_with;
}
}
>
Some destructor seems to be getting called within this function, on an
improperly constructed object, in the body of the loop (at the end of
it). Why would that be?
Right. My assignment operator wasn't returning anything. Fixed. Sorry.
Closed Thread