Skip to content

Instabug spawns and keeps threads even when not initialized or disabled #461

Open
@gpunto

Description

@gpunto

Steps to Reproduce the Problem

  1. Add Instabug as a dependency to a project without adding any initialization code
  2. Launch the app
  3. Check the existing threads, e.g. by debugging or by printing their names to the console

Expected Behavior

No Instabug thread exists if Instabug is not enabled.

Actual Behavior

Multiple Instabug threads exist. For example:

IBG-API-executor-0
IBG-SharedPrefs-0
IBG-core-io-executor-0
IBG-core-io-executor-1
IBG-v3-session-0

Instabug integration code

None. Adding an explicit call to Instabug.disable() yields the same behavior.

SDK Version

12.2.0

Android Version

Any.

Device Model

Any.

Project That Reproduces the Issue

I can upload a project if needed, but it would only contain these changes:

In the build script:

implementation("com.instabug.library:instabug:12.2.0")

In the Activity:

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        Instabug.disable()

        setContent {
            IBThreadsTheme {
                Button(onClick = {
                    Thread.getAllStackTraces().map { it.key.name }.sorted().forEach {
                        Log.i("hjkl", it)
                    }
                }) {
                    Text("Click")
                }
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions