[vdr] Problem with cChannel's copy constructor

Marcel Wiesweg marcel.wiesweg at gmx.de
Thu Aug 4 15:17:54 CEST 2005


I just ran into a problem with cChannel's copy constructor.
The problem is that this is actually not a copy constructor, because it sets 
the values to 0 instead of copying, and - most important - it behaves 
different from operator=.

It seems these two are not used in VDR except for one place (where I found 
this), cSectionHandler::SetChannel. The value stored by cSectionHandle has 
nid,tid,sid set to 0.
In the line 
  shp->channel = Channel ? *Channel : cChannel();
there seems only the operator= involved, but actually the copy constructor is 
invoked before the *Channel is given to opertator=.
Attached is a short test program which illustrates the problem.

Solution is to make the copy constructor do copying.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 670 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/vdr/attachments/20050804/739ff040/test.c

More information about the vdr mailing list