Opened 7 years ago

Closed 7 years ago

#2121 closed defect (fixed)

SWIG exception in mapping an invalid C++ enum value to Java

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-2.8
Component: pjsua2 Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description

Sample exception message:

Swig::DirectorException: No enum class org.pjsip.pjsua2.pjsip_tsx_state_e
                         with value 377750600

SWIG requires C++ enum data to have a valid value so it can be correctly mapped to Java enum object. Unfortunately some PJSUA2 C++ objects do not initialize basic type data member (including enum) in its constructor and such uninitialized data member may have an invalid value, so when SWIG needs to map an invalid C++ enum value to Java, exception occurs.

Kazuhiko Yoneda for the report and the patch.

Change History (1)

comment:1 Changed 7 years ago by nanang

  • Resolution set to fixed
  • Status changed from new to closed

In 5807:

Fix #2121: Initialize basic type data member of PJSUA2/C++ objects in its constructor.

Note: See TracTickets for help on using tickets.