Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
dab5cc72
Commit
dab5cc72
authored
Jan 08, 2016
by
François Grisez
Browse files
Fixes JNI crashes around LinphoneConference.getParticipants()
parent
804fd8a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
coreapi/linphonecore_jni.cc
View file @
dab5cc72
...
...
@@ -6746,20 +6746,20 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCoreImpl_getNortpTimeout(J
JNIEXPORT
jobject
JNICALL
Java_org_linphone_core_LinphoneConferenceImpl_getParticipants
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
pconference
)
{
JNIEXPORT
jobject
Array
JNICALL
Java_org_linphone_core_LinphoneConferenceImpl_getParticipants
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
pconference
)
{
MSList
*
participants
,
*
it
;
jclass
addr_class
=
env
->
FindClass
(
"org/linphone/core/LinphoneAddressImpl"
);
jclass
addr_list_class
=
env
->
FindClass
(
"[Lorg/linphone/core/LinphoneAddressImpl;"
);
jmethodID
addr_constructor
=
env
->
GetMethodID
(
addr_class
,
"<init>"
,
"(J)"
);
jmethodID
addr_list_constructor
=
env
->
GetMethodID
(
addr_list_class
,
"<init>"
,
"(V)"
);
jmethodID
addr_list_append
=
env
->
GetMethodID
(
addr_list_class
,
"add"
,
"(Lorg/linphone/core/LinphoneAddressImpl;)Z"
);
jobject
jaddr_list
=
env
->
NewObject
(
addr_list_class
,
addr_list_constructor
);
jobjectArray
jaddr_list
;
int
i
;
participants
=
linphone_conference_get_participants
((
LinphoneConference
*
)
pconference
);
for
(
it
=
participants
;
it
;
it
=
ms_list_next
(
it
))
{
jaddr_list
=
env
->
NewObjectArray
(
ms_list_size
(
participants
),
addr_class
,
NULL
);
for
(
it
=
participants
,
i
=
0
;
it
;
it
=
ms_list_next
(
it
),
i
++
)
{
LinphoneAddress
*
addr
=
(
LinphoneAddress
*
)
it
->
data
;
jobject
jaddr
=
env
->
NewObject
(
addr_class
,
addr_constructor
,
addr
);
env
->
CallBooleanMethod
(
jaddr_list
,
addr_list_append
,
jaddr
);
env
->
SetObjectArrayElement
(
jaddr_list
,
i
,
jaddr
);
}
return
jaddr_list
;
}
...
...
java/common/org/linphone/core/LinphoneConference.java
View file @
dab5cc72
...
...
@@ -29,7 +29,7 @@ public interface LinphoneConference {
/**
* Get the URIs of all participants of the conference
*/
public
List
<
LinphoneAddress
>
getParticipants
();
public
LinphoneAddress
[]
getParticipants
();
/**
* Remove a participant from the conference
* @param uri The URI of the participant to remove
...
...
java/impl/org/linphone/core/LinphoneConferenceImpl.java
View file @
dab5cc72
...
...
@@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package
org.linphone.core
;
import
org.linphone.core.LinphoneConference
;
import
java.util.List
;
public
class
LinphoneConferenceImpl
implements
LinphoneConference
{
private
final
long
nativePtr
;
...
...
@@ -30,8 +29,8 @@ public class LinphoneConferenceImpl implements LinphoneConference {
this
.
nativePtr
=
nativePtr
;
}
private
native
List
<
LinphoneAddress
>
getParticipants
(
long
nativePtr
);
public
List
<
LinphoneAddress
>
getParticipants
()
{
private
native
LinphoneAddress
[]
getParticipants
(
long
nativePtr
);
public
LinphoneAddress
[]
getParticipants
()
{
return
getParticipants
(
nativePtr
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment