Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

Commit

Permalink
Update GameSharing.cpp
Browse files Browse the repository at this point in the history
Fix for bug #5
  • Loading branch information
dwd31415 committed Nov 27, 2014
1 parent 5f86349 commit 3e83838
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions C++/GameSharing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,13 @@ void GameSharing::SubmitScore(int score,int leaderboardID)
, "(I)V"))
{
t.env->CallStaticVoidMethod(t.classID, t.methodID, leaderboardID);
// Release
t.env->DeleteLocalRef(t.classID);
}
if (JniHelper::getStaticMethodInfo(t
, "org/cocos2dx/cpp.AppActivity"
, "submitScoreToLeaderboard"
, "(I)V"))
{
t.env->CallStaticVoidMethod(t.classID, t.methodID, score);
// Release
t.env->DeleteLocalRef(t.classID);
}
}
#endif
Expand All @@ -93,17 +89,13 @@ void GameSharing::ShowLeaderboards(int id){
, "(I)V"))
{
t.env->CallStaticVoidMethod(t.classID, t.methodID, id);
// Release
t.env->DeleteLocalRef(t.classID);
}
if (JniHelper::getStaticMethodInfo(t
, "org/cocos2dx/cpp.AppActivity"
, "openLeaderboardUI"
, "()V"))
{
t.env->CallStaticVoidMethod(t.classID, t.methodID);
// Release
t.env->DeleteLocalRef(t.classID);
}
}
else{
Expand All @@ -127,8 +119,6 @@ void GameSharing::UnlockAchivement(int ID)
, "(I)V"))
{
t.env->CallStaticVoidMethod(t.classID, t.methodID , ID);
// Release
t.env->DeleteLocalRef(t.classID);
}
JniMethodInfo tmp;
if (JniHelper::getStaticMethodInfo(tmp
Expand All @@ -137,8 +127,6 @@ void GameSharing::UnlockAchivement(int ID)
, "(I)V"))
{
tmp.env->CallStaticVoidMethod(tmp.classID, tmp.methodID , 100);
// Release
tmp.env->DeleteLocalRef(t.classID);
}
}
else{
Expand All @@ -160,8 +148,6 @@ void GameSharing::ShowAchievementsUI(){
, "()V"))
{
t.env->CallStaticVoidMethod(t.classID, t.methodID);
// Release
t.env->DeleteLocalRef(t.classID);
}
}
else{
Expand All @@ -184,8 +170,6 @@ bool GameSharing::IsGPGAvailable(){
, "()Z"))
{
tmp = t.env->CallStaticBooleanMethod(t.classID, t.methodID);
// Release
t.env->DeleteLocalRef(t.classID);
}
#endif
bIsGPGAvailable = tmp;
Expand All @@ -207,8 +191,6 @@ void GameSharing::ExitGame(){
, "()V"))
{
t.env->CallStaticVoidMethod(t.classID, t.methodID);
// Release
t.env->DeleteLocalRef(t.classID);
}
#else
Director::getInstance()->end();
Expand Down

0 comments on commit 3e83838

Please sign in to comment.