0
을 해체, 나는 작은 문제가있을 때. 나는 아래라는 기능을 언급하지 않을 경우 이미지가힙 손상 그래서 SFML에서 페이드 전이 SF에 대한 애니메이션 :: 이미지를 만들기 위해 노력하고있어 김포 :: 이미지 배열
은 "Windows가 중단 점을 트리거하고있다 .이있을 수 있습니다 인해 말을 해체 될 때
, 나는
main()
의 말에 오류가 힙의 손상 . "
이가 일어나는 줄은
GLCheck(glDeleteTextures(1, &Texture));
왜 이런 일이 될 것입니다 코드를 포함하고 CreateTransition는() 이유를 실행하는 경우에만?
하나 더 참고 : 나는 aray[I] = aray[0]
을 주석 때 브레이크가 발생하지 않습니다.
다음 기능을 게시했습니다. 당신이 원인을 좁힐 수 있습니다
void CreateTransition(sf::Image& start, sf::Image animationArray[numbImgs]){
animationArray[0] = start;
void threadFunc(void* imgArray);
sf::Thread thread(threadFunc, reinterpret_cast<void*>(animationArray));
thread.Launch();
thread.Wait(); // comment this out once I get the code working
}
void threadFunc(void* ptr){
sf::Image* aray = reinterpret_cast<sf::Image*> (ptr);
sf::Color filter(0, 0, 0, 5);
for(int I= 1; I< numbImgs; I++){
//aray[I].Copy(aray[0], 0, 0, sf::IntRect(0, 0, 0, 0), true);
aray[I] = aray[0]; // error doesn't occur when commented out
RecolorImage(aray[I], filter);
}
}
Image& Image::operator =(const Image& Other)
{
Image Temp(Other);
std::swap(myWidth, Temp.myWidth);
std::swap(myHeight, Temp.myHeight);
std::swap(myTextureWidth, Temp.myTextureWidth);
std::swap(myTextureHeight, Temp.myTextureHeight);
std::swap(myTexture, Temp.myTexture);
std::swap(myIsSmooth, Temp.myIsSmooth);
std::swap(myNeedArrayUpdate, Temp.myNeedArrayUpdate);
std::swap(myNeedTextureUpdate, Temp.myNeedTextureUpdate);
myPixels.swap(Temp.myPixels);
return *this;
}