Skip to content

Commit

Permalink
Merge pull request #671 from ulmus-scott/mythcontext
Browse files Browse the repository at this point in the history
MythContext refactoring (remove gContext)
  • Loading branch information
linuxdude42 authored Feb 26, 2025
2 parents 9e44f37 + e198c2a commit 3c690f4
Show file tree
Hide file tree
Showing 46 changed files with 336 additions and 677 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2391,12 +2391,10 @@ static int main_local(int argc, char **argv)
// Don't listen to console input
close(0);

gContext = new MythContext(MYTH_BINARY_VERSION);
if (!gContext->Init(false))
MythContext context {MYTH_BINARY_VERSION};
if (!context.Init(false))
{
LOG(VB_GENERAL, LOG_ERR, "Failed to init MythContext, exiting.");
delete gContext;
gContext = nullptr;
return GENERIC_EXIT_NO_MYTHCONTEXT;
}

Expand Down Expand Up @@ -2557,9 +2555,6 @@ static int main_local(int argc, char **argv)
cmdline.PrintHelp();
}

delete gContext;
gContext = nullptr;

exit(res);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ int main(int argc, char *argv[])
// Don't listen to console input
close(0);

gContext = new MythContext(MYTH_BINARY_VERSION);
if (!gContext->Init(false))
MythContext context {MYTH_BINARY_VERSION};
if (!context.Init(false))
{
LOG(VB_GENERAL, LOG_ERR, "Failed to init MythContext, exiting.");
delete gContext;
return GENERIC_EXIT_NO_MYTHCONTEXT;
}

Expand Down Expand Up @@ -149,7 +148,6 @@ int main(int argc, char *argv[])

delete gdt;
delete rssMan;
delete gContext;

LOG(VB_GENERAL, LOG_INFO, "MythFillNetvision run complete.");

Expand Down
2 changes: 1 addition & 1 deletion mythtv/bindings/php/MythBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class MythBackend {

// MYTH_PROTO_VERSION is defined in libmyth in mythtv/libs/libmyth/mythcontext.h
// MYTH_PROTO_VERSION is defined in libmythbase in mythtv/libs/libmythbase/mythversion.h
// and should be the current MythTV protocol version.
static $protocol_version = '91';
static $protocol_token = 'BuzzOff';
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/dbsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void DatabaseSettings::Save(void)
params.m_wolRetry = m_wolRetry->intValue();
params.m_wolCommand = m_wolCommand->getValue();

gContext->SaveDatabaseParams(params);
GetMythDB()->SaveDatabaseParams(params, false);
//set all the children's m_haveChanged to false
GroupSetting::Save();
}
Expand Down
Loading

0 comments on commit 3c690f4

Please sign in to comment.