mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-10 16:28:17 +03:00
Do not stack-allocate MAKOMidi
It causes stack overflow in MSVS build.
This commit is contained in:
+4
-4
@@ -119,10 +119,10 @@ void MAKO::play_music(int page)
|
||||
Mix_HookMusic(&FMHook, this);
|
||||
SDL_UnlockMutex(fm_mutex);
|
||||
} else {
|
||||
MAKOMidi midi(nact, amus);
|
||||
if (midi.load_mml(page)) {
|
||||
midi.load_mda(page);
|
||||
smf = midi.generate_smf(next_loop);
|
||||
auto midi = std::make_unique<MAKOMidi>(nact, amus);
|
||||
if (midi->load_mml(page)) {
|
||||
midi->load_mda(page);
|
||||
smf = midi->generate_smf(next_loop);
|
||||
SDL_RWops *rwops = SDL_RWFromConstMem(smf.data(), smf.size());
|
||||
mix_music = Mix_LoadMUSType_RW(rwops, MUS_MID, SDL_TRUE /* freesrc */);
|
||||
if (!mix_music) {
|
||||
|
||||
Reference in New Issue
Block a user