Skip to content

Commit

Permalink
[CI] fix crash when CI module is deactivated in the menu
Browse files Browse the repository at this point in the history
-Initialize all pointers and variables in the constructor
to avoid crash.

thanks @betacentauri
  • Loading branch information
Dima73 authored and koivo committed Apr 24, 2024
1 parent 32cce38 commit d826576
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/dvb_ci/dvbci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,13 @@ eDVBCISlot::eDVBCISlot(eMainloop *context, int nr)
slotid = nr;
m_context = context;
state = stateDisabled;
application_manager = 0;
mmi_session = 0;
ca_manager = 0;
use_count = 0;
linked_next = 0;
user_mapped = false;
plugged = true;
snprintf(configStr, 255, "config.ci.%d.enabled", slotid);
bool enabled = eSimpleConfig::getBool(configStr, true);
if (enabled)
Expand All @@ -1572,12 +1579,6 @@ void eDVBCISlot::openDevice()
{
char filename[128];

application_manager = 0;
mmi_session = 0;
ca_manager = 0;
use_count = 0;
linked_next = 0;
user_mapped = false;
plugged = true;

#ifdef __sh__
Expand Down

1 comment on commit d826576

@Dima73
Copy link
Contributor Author

@Dima73 Dima73 commented on d826576 Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plugged = false;

Please sign in to comment.