Skip to content

Commit 617e7ea

Browse files
committed
discardme: Add debug logging
1 parent 4ec36dd commit 617e7ea

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

frontend/OBSApp.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,7 @@ OBSApp::OBSApp(int &argc, char **argv, profiler_name_store_t *store)
955955

956956
OBSApp::~OBSApp()
957957
{
958+
blog(LOG_INFO, "[OBSApp] Destructor");
958959
if (libobs_initialized) {
959960
applicationShutdown();
960961
}
@@ -1807,6 +1808,7 @@ bool WindowPositionValid(QRect rect)
18071808
#ifndef _WIN32
18081809
void OBSApp::SigIntSignalHandler(int s)
18091810
{
1811+
blog(LOG_INFO, "[OBSApp] SigIntSignalHandler");
18101812
/* Handles SIGINT and writes to a socket. Qt will read
18111813
* from the socket in the main thread event loop and trigger
18121814
* a call to the ProcessSigInt slot, where we can safely run
@@ -1819,6 +1821,8 @@ void OBSApp::SigIntSignalHandler(int s)
18191821

18201822
void OBSApp::SigTermSignalHandler(int s)
18211823
{
1824+
blog(LOG_INFO, "[OBSApp] SigTermSignalHandler");
1825+
18221826
UNUSED_PARAMETER(s);
18231827

18241828
char a = 1;
@@ -1831,6 +1835,8 @@ void OBSApp::ProcessSigInt(void)
18311835
/* This looks weird, but we can't ifdef a Qt slot function so
18321836
* the SIGINT handler simply does nothing on Windows. */
18331837
#ifndef _WIN32
1838+
blog(LOG_INFO, "[OBSApp] ProcessSigInt");
1839+
18341840
char tmp;
18351841
recv(sigintFd[1], &tmp, sizeof(tmp), 0);
18361842

@@ -1845,6 +1851,8 @@ void OBSApp::ProcessSigInt(void)
18451851
void OBSApp::ProcessSigTerm(void)
18461852
{
18471853
#ifndef _WIN32
1854+
blog(LOG_INFO, "[OBSApp] ProcessSigTerm");
1855+
18481856
char tmp;
18491857
recv(sigtermFd[1], &tmp, sizeof(tmp), 0);
18501858

@@ -1861,6 +1869,7 @@ void OBSApp::commitData(QSessionManager &manager)
18611869
{
18621870
OBSBasic *main = OBSBasic::Get();
18631871
if (main) {
1872+
blog(LOG_INFO, "[OBSApp] commitData");
18641873
main->saveAll();
18651874

18661875
if (manager.allowsInteraction() && main->shouldPromptForClose()) {
@@ -1897,6 +1906,7 @@ void OBSApp::applicationShutdown() noexcept
18971906
os_inhibit_sleep_destroy(sleepInhibitor);
18981907

18991908
if (libobs_initialized) {
1909+
blog(LOG_INFO, "[OBSApp] Calling obs_shutdown");
19001910
obs_shutdown();
19011911
libobs_initialized = false;
19021912
}

frontend/widgets/OBSBasic.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,9 @@ void OBSBasic::OnFirstLoad()
13731373

13741374
OBSBasic::~OBSBasic()
13751375
{
1376+
blog(LOG_INFO, "[OBSBasic] Destructor");
13761377
if (!isClosing()) {
1378+
blog(LOG_INFO, "[OBSBasic] Destructor calling closeWindow");
13771379
closeWindow();
13781380
}
13791381
}
@@ -1685,6 +1687,7 @@ void OBSBasic::closeEvent(QCloseEvent *event)
16851687
restart = false;
16861688

16871689
if (!isClosePromptOpen) {
1690+
blog(LOG_INFO, "[OBSBasic] Prompting for close");
16881691
bool shouldClose = promptToClose();
16891692

16901693
if (shouldClose) {
@@ -1700,6 +1703,7 @@ void OBSBasic::closeEvent(QCloseEvent *event)
17001703
return;
17011704
}
17021705

1706+
blog(LOG_INFO, "[OBSBasic] closeEvent calling closeWindow");
17031707
closeWindow();
17041708
}
17051709

libobs/obs.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,6 +1356,7 @@ struct obs_cmdline_args obs_get_cmdline_args(void)
13561356

13571357
void obs_shutdown(void)
13581358
{
1359+
blog(LOG_INFO, "[libobs] Beginning obs_shutdown");
13591360
struct obs_module *module;
13601361

13611362
obs_wait_for_destroy_queue();
@@ -1389,10 +1390,14 @@ void obs_shutdown(void)
13891390
da_free(obs->filter_types);
13901391
da_free(obs->transition_types);
13911392

1393+
blog(LOG_INFO, "[libobs] Freed all types");
1394+
13921395
stop_video();
13931396
stop_audio();
13941397
stop_hotkeys();
13951398

1399+
blog(LOG_INFO, "[libobs] Stopped audio/video");
1400+
13961401
module = obs->first_module;
13971402
while (module) {
13981403
struct obs_module *next = module->next;
@@ -1409,17 +1414,22 @@ void obs_shutdown(void)
14091414
}
14101415
obs->first_disabled_module = NULL;
14111416

1417+
blog(LOG_INFO, "[libobs] Freed modules");
1418+
14121419
obs_free_data();
14131420
obs_free_audio();
14141421
obs_free_video();
14151422
os_task_queue_destroy(obs->destruction_task_thread);
14161423
obs_free_hotkeys();
14171424
obs_free_graphics();
1425+
blog(LOG_INFO, "[libobs] Freed data");
14181426
proc_handler_destroy(obs->procs);
14191427
signal_handler_destroy(obs->signals);
14201428
obs->procs = NULL;
14211429
obs->signals = NULL;
14221430

1431+
blog(LOG_INFO, "[libobs] Freed signals");
1432+
14231433
for (size_t i = 0; i < obs->module_paths.num; i++) {
14241434
free_module_path(obs->module_paths.array + i);
14251435
}
@@ -1440,6 +1450,8 @@ void obs_shutdown(void)
14401450
}
14411451
da_free(obs->core_modules);
14421452

1453+
blog(LOG_INFO, "[libobs] Freed module paths");
1454+
14431455
if (obs->name_store_owned)
14441456
profiler_name_store_free(obs->name_store);
14451457

@@ -1449,6 +1461,8 @@ void obs_shutdown(void)
14491461
obs = NULL;
14501462
bfree(cmdline_args.argv);
14511463

1464+
blog(LOG_INFO, "[libobs] Completed obs_shutdown");
1465+
14521466
#ifdef _WIN32
14531467
if (com_initialized)
14541468
uninitialize_com();

0 commit comments

Comments
 (0)