Added JNI glue for destroy method of LinphoneChatRoom

This commit is contained in:
Sylvain Berfini 2013-08-12 09:39:38 +02:00
parent 2db0e99c54
commit 3e2f306e36
3 changed files with 16 additions and 0 deletions

View file

@ -2078,6 +2078,12 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createLinphoneChatM
return (jlong) chatMessage;
}
extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_destroy(JNIEnv* env
,jobject thiz
,jlong ptr) {
linphone_chat_room_destroy((LinphoneChatRoom*)ptr);
}
extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_setUserData(JNIEnv* env
,jobject thiz
,jlong ptr) {

View file

@ -54,4 +54,9 @@ public interface LinphoneChatRoom {
* @return an array of LinphoneChatMessage
*/
LinphoneChatMessage[] getHistory();
/**
* Destroys a LinphoneChatRoom.
*/
void destroy();
}

View file

@ -27,6 +27,7 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
private native void sendMessage(long ptr, String message);
private native void sendMessage2(long ptr, long message, StateListener listener);
private native long[] getHistory(long ptr);
private native void destroy(long ptr);
protected LinphoneChatRoomImpl(long aNativePtr) {
nativePtr = aNativePtr;
@ -62,4 +63,8 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
return messages;
}
public void destroy() {
destroy(nativePtr);
}
}