Miles Sample read 할때 메모리 leak이 납니다.

2권에서 새로 도입된 오디오 프로그래밍 섹션에 대한 게시판입니다.

Moderator: 류광

Locked
울레리오
Posts: 10
Joined: 2008-05-28 17:05
Location: SoftNyx

Miles Sample read 할때 메모리 leak이 납니다.

Post by 울레리오 »

pDataIndex = (U32*) AIL_file_read(filename, FILE_READ_WITH_SIZE);

로 read를 하고 해제할때는

AIL_end_sample(Sample[index]);
AIL_release_sample_handle(Sample[index]);
pDataIndex = 0;

이런식으로 하고있는데요~ 틀린게 있는건지 메모리가 새네요..

그리고 mss32.dll 자체에서도 메모리 leak이 납니다.. -_-

당췌 왜그런건지 모르겠네요

ps.. mss 버젼은 7.0w 입니다~
비회원

Post by 비회원 »

AIL_end_sample(Sample[index]);
AIL_release_sample_handle(Sample[index]);
pDataIndex = 0;

위의 코드 두가지는 read한 메모리를 해제하기보다는 상태를 변화하거나 상태를 이전하는 기능입니다.

AIL_end_sample(Sample[index]);

AIL_end_sample의 기능은 녹음 재생기를 끝내면서 SMP_DONE로 상태를 셋트 하는 것입니다.
The function AIL_end_sample terminates playback of a sample, setting its status to SMP_DONE.

AIL_release_sample_handle(Sample[index]);

AIL_release_sample_handle은 AIL_allocate_sample_handle전에 할당된 견본 핸들을 느리게 하는것입니다.
The function AIL_release_sample_handle releases a sample handle previously allocated with AIL_allocate_sample_handle.


이 코드는 사용하는것보다는

AIL_mem_free_lock(pDataIndex);
pDataIndex = 0;

AIL_mem_free_lock 의 코드를 사용해 보시길 바랍니다.

국내 Radgametools사의 Granny3D, Miles sound, Bink video 총판 업체가 있다고 하던데, 다른 문의 있으시면 그쪽으로 연락 해 보셔도 될 듯 하네요.
www.toogees.co.kr
울레리오
Posts: 10
Joined: 2008-05-28 17:05
Location: SoftNyx

감사합니다

Post by 울레리오 »

AIL_end_sample(Sample[index]); 는 상태를 바꾸는건 알고있었는데

AIL_release_sample_handle(Sample[index]); 이게 메모리 해제하는게 아니었군요~-0-

AIL_mem_free_lock(pDataIndex); 하니 메모리 leak 이 해결되었습니다..감사합니다

근데 mss32.dll 자체에서 새는건 총판에 물어보던지 해야겠네요~ :D
비회원

위에

Post by 비회원 »

게임중에 또 메모리 leak이 나서 더 뒤져보니

samples[index] = AIL_allocate_sample_handle( dig ); 로 잡은

AIL_release_sample_handle(Sample[index]);

해줘야 완벽히 되는거 같습니다.. 둘다 해줘야되네요~ :D
Locked