My app will freeze (not crash) after calling DeleteMusicOGG enough times. This only happens on Android. Well I have only tested it on the Android Google Play Template. Going back to older versions of AppGameKit, this bug didn't exist in version 12.2017.
A wrote a simple program to recreate the issue. It will load, play, stop and delete a music "ogg" file every frame to quickly reproduce the error. I also uploaded a couple of OGG files and a debug apk of the program to help you research the issue quickly.
This is Tier 2.
// Namespace
using namespace AGK;
using namespace std;
int iCount = 0;
bool bLoaded = false;
int iSwitch = 0;
string sFilename;
app App;
void app::Begin(void)
{
agk::SetVirtualResolution (1024, 768);
agk::SetClearColor( 151,170,204 ); // light blue
agk::SetSyncRate(60,0);
agk::SetScissor(0,0,0,0);
}
int app::Loop (void)
{
iCount++;
agk::Print(iCount);
iSwitch = 1 - iSwitch; // Toggle Switch between 1 and 0
if (iSwitch == 0) sFilename = "1.ogg";
if (iSwitch == 1) sFilename = "2.ogg";
if (agk::GetFileExists(sFilename.c_str()))
{
if (bLoaded)
{
agk::StopMusicOGG(1);
agk::DeleteMusicOGG(1); // Sometime causes the app to stop responding
}
agk::LoadMusicOGG(1, sFilename.c_str());
agk::PlayMusicOGG(1, 1);
bLoaded = true;
}
agk::Sync();
return 0; // return 1 to close app
}
void app::End (void)
{
}