Opened 11 years ago

Closed 11 years ago

#5311 closed task (invalid)

Write QString replacement

Reported by: danielk Owned by: danielk
Priority: blocker Milestone: 0.22
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Even in Qt4, QString is not thread-safe. We need to write an MString class with the capabilities of QString but without the constant segfaults.

Attachments (1)

mstring.diff (46.9 KB) - added by jpbrock@… 11 years ago.
MString, a thread-safe replacement for QString

Download all attachments as: .zip

Change History (11)

comment:1 Changed 11 years ago by danielk

Priority: minorblocker

comment:2 Changed 11 years ago by danielk

(In [17846]) Refs #5311. Replaces most ascii()/utf8()/latin1() calls in libmyth with safer alternatives.

comment:3 Changed 11 years ago by danielk

(In [17852]) Refs #5311. Eliminates all ascii()/utf8()/latin1() calls & most Q3CString instances in libmythupnp.

comment:4 Changed 11 years ago by danielk

(In [17881]) Refs #5311. Fixes a number of instances of unsafe QString usage in MythTV.

comment:5 Changed 11 years ago by danielk

(In [17886]) Refs #5311. Removes remaining QString::ascii() uses in mythtv proper; plugins still have not been addressed.

comment:6 Changed 11 years ago by danielk

(In [17887]) Refs #5311. Gets rid of some Q3DeepCopy uses.

comment:7 Changed 11 years ago by danielk

(In [17906]) Refs #5311. ascii()/utf8()/latin1()/local8Bit() removals and related fixes for mythplugins.

comment:8 Changed 11 years ago by stuartm

See #4768

Changed 11 years ago by jpbrock@…

Attachment: mstring.diff added

MString, a thread-safe replacement for QString

comment:9 Changed 11 years ago by Dibblah

Status: newassigned
Type: defecttask

comment:10 Changed 11 years ago by danielk

Resolution: invalid
Status: assignedclosed

After converting a large number of files to Qt4, I don't think we need to introduce a new thread safe string class anymore. Assignments in Qt4 are really atomic and the very unsafe ascii()/utf8()/latin1()/local8Bit() functions were causing most of the remaining segfaults (and are now removed from the class). The remaining bugs are specific to certain classes used by multiple threads using QStrings without a mutex protecting them (ChannelBase? for instance). Those errors should be addressed on a case by case basis as those classes will probably unsafely use any number of other variables, not just strings.

Note: See TracTickets for help on using tickets.