Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-109397

Crash in QtBluetoothBroadcastReceiver.java due to null qtContext

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P1: Critical
    • None
    • 6.4.0
    • None
    • Android

    Description

      In an application using Qt 6.4.0, we do a scan for devices (which works successfully) and then attempt to connect to a specific device via a call to QLowEnergyController::connectToDevice().

      Almost immediately thereafter, the application crashes inside the onReceive() method of QtBluetoothBroadcastReceiver.java, because the qtContext is null.

       

      Is this a bug in QtBluetooth?  Or, are we doing something wrong?  What is supposed to call setContext()?

      From a brief inspection of the code, it seems like maybe the constructor in androidbroadcastreceiver.cpp might be the correct place, but it does not do so (or perhaps the value is invalid at that point).

       

      Any hints about what we need to do to ensure that the context object is valid, would be appreciated.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ablasche Alex Blasche
            chrisadams Christopher Adams
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes