Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add an atexit() handler to delete the MythDownloadManager singleton.

(cherry picked from commit 26ab0d1)
  • Loading branch information...
commit 613079eef4a3a1faf9cf513b44551173f06e07a6 1 parent 8d1c058
@cpinkham cpinkham authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 mythtv/libs/libmythdb/mythdownloadmanager.cpp
View
14 mythtv/libs/libmythdb/mythdownloadmanager.cpp
@@ -110,6 +110,18 @@ class RemoteFileDownloadThread : public QRunnable
MythDownloadInfo *m_dlInfo;
};
+/** \fn ShutdownMythDownloadManager(void)
+ * \brief Deletes the running MythDownloadManager at program exit.
+ */
+void ShutdownMythDownloadManager(void)
+{
+ if (downloadManager)
+ {
+ delete downloadManager;
+ downloadManager = NULL;
+ }
+}
+
/** \fn GetMythDownloadManger(void)
* \brief Gets the pointer to the MythDownloadManager singleton.
* \return Pointer to the MythDownloadManager instance
@@ -128,6 +140,8 @@ MythDownloadManager *GetMythDownloadManager(void)
while (!downloadManager->isRunning())
usleep(10000);
+
+ atexit(ShutdownMythDownloadManager);
}
return downloadManager;
Please sign in to comment.
Something went wrong with that request. Please try again.