[mythtv] patch for 6544 memory leaks
Kirby Vandivort
kvandivo at ks.uiuc.edu
Mon Sep 29 13:52:28 EDT 2003
attached is a patch which fixes a couple of memory leaks when going to
6544 and also specifically notes when a tuner is busy watching/recording
live tv.
--
Kirby Vandivort Theoretical and
Senior Research Programmer Computational Biophysics
Email: kvandivo at ks.uiuc.edu 3051 Beckman Institute
http://www.ks.uiuc.edu/~kvandivo/ University of Illinois
Phone: (217) 244-5711 405 N. Mathews Ave
Fax : (217) 244-6078 Urbana, IL 61801, USA
-------------- next part --------------
Index: programs/mythbackend/encoderlink.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythbackend/encoderlink.cpp,v
retrieving revision 1.26
diff -b -u -2 -r1.26 encoderlink.cpp
--- programs/mythbackend/encoderlink.cpp 12 Sep 2003 16:49:54 -0000 1.26
+++ programs/mythbackend/encoderlink.cpp 29 Sep 2003 17:46:36 -0000
@@ -76,4 +76,9 @@
}
+bool EncoderLink::IsBusyWatchingLiveTV(void)
+{
+ return (GetState() == kState_WatchingLiveTV);
+}
+
bool EncoderLink::isConnected(void)
{
Index: programs/mythbackend/encoderlink.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythbackend/encoderlink.h,v
retrieving revision 1.24
diff -b -u -2 -r1.24 encoderlink.h
--- programs/mythbackend/encoderlink.h 12 Sep 2003 16:49:54 -0000 1.24
+++ programs/mythbackend/encoderlink.h 29 Sep 2003 17:46:36 -0000
@@ -41,4 +41,5 @@
bool IsBusy(void);
bool IsBusyRecording(void);
+ bool IsBusyWatchingLiveTV(void);
TVState GetState();
Index: programs/mythbackend/mainserver.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythbackend/mainserver.cpp,v
retrieving revision 1.82
diff -b -u -2 -r1.82 mainserver.cpp
--- programs/mythbackend/mainserver.cpp 24 Sep 2003 23:40:00 -0000 1.82
+++ programs/mythbackend/mainserver.cpp 29 Sep 2003 17:46:41 -0000
@@ -2334,5 +2363,9 @@
}
- if (elink->IsBusyRecording())
+ if (elink->IsBusyWatchingLiveTV())
+ {
+ os << "is watching Live TV";
+ }
+ else if (elink->IsBusyRecording())
{
os << "is recording";
@@ -2340,5 +2373,9 @@
{
ProgramInfo *pi = elink->GetRecording();
+ if (pi)
+ {
os << " '" << pi->title << "'";
+ delete pi;
+ }
}
os << ".\r\n";
@@ -2396,4 +2433,6 @@
}
+ delete sched; sched=0;
+
os << "<P>Machine Information:\r\n";
os << "<TABLE WIDTH =100% BGCOLOR=EEEEEE>";
@@ -2424,11 +2463,13 @@
// load average ---------------------
+ double rgdAverages[3];
+ if (-1 != getloadavg(rgdAverages, 3)) // don't bother if the call fails
+ {
os << "This machine's load average:";
- double rgdAverages[3];
- getloadavg(rgdAverages, 3);
os << "<UL><LI>1 Minute: " << rgdAverages[0] << "\r\n";
os << "<LI>5 Minute: " << rgdAverages[1] << "\r\n";
os << "<LI>15 Minute: " << rgdAverages[2] << "\r\n</UL>";
+ }
os << "</TD></TR></TABLE>"; // end the machine information table
More information about the mythtv-dev
mailing list