mirror of
https://github.com/status-im/qzxing.git
synced 2025-02-18 13:57:03 +00:00
Fix memory leaks.
This commit is contained in:
parent
00d0e8d8d0
commit
7e92f2981c
@ -60,7 +60,7 @@ private:
|
|||||||
//static bool isOnlyDoubleByteKanji(const QString& content);
|
//static bool isOnlyDoubleByteKanji(const QString& content);
|
||||||
|
|
||||||
static int chooseMaskPattern(Ref<BitArray> bits,
|
static int chooseMaskPattern(Ref<BitArray> bits,
|
||||||
ErrorCorrectionLevel ecLevel,
|
ErrorCorrectionLevel& ecLevel,
|
||||||
Ref<Version> version,
|
Ref<Version> version,
|
||||||
Ref<ByteMatrix> matrix);
|
Ref<ByteMatrix> matrix);
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ Ref<QRCode> Encoder::encode(const QString& content, ErrorCorrectionLevel &ecLeve
|
|||||||
// Put data together into the overall payload
|
// Put data together into the overall payload
|
||||||
headerAndDataBits.appendBitArray(dataBits);
|
headerAndDataBits.appendBitArray(dataBits);
|
||||||
|
|
||||||
zxing::qrcode::ECBlocks ecBlocks = version->getECBlocksForLevel(ecLevel);
|
zxing::qrcode::ECBlocks &ecBlocks = version->getECBlocksForLevel(ecLevel);
|
||||||
int numDataBytes = version->getTotalCodewords() - ecBlocks.getTotalECCodewords();
|
int numDataBytes = version->getTotalCodewords() - ecBlocks.getTotalECCodewords();
|
||||||
|
|
||||||
// Terminate the bits properly.
|
// Terminate the bits properly.
|
||||||
@ -111,7 +111,7 @@ Ref<QRCode> Encoder::encode(const QString& content, ErrorCorrectionLevel &ecLeve
|
|||||||
|
|
||||||
Ref<QRCode> qrCode(new QRCode);
|
Ref<QRCode> qrCode(new QRCode);
|
||||||
|
|
||||||
qrCode->setECLevel(Ref<ErrorCorrectionLevel>(&ecLevel));
|
qrCode->setECLevel(Ref<ErrorCorrectionLevel>(new ErrorCorrectionLevel(ecLevel)));
|
||||||
qrCode->setMode(mode);
|
qrCode->setMode(mode);
|
||||||
qrCode->setVersion(version);
|
qrCode->setVersion(version);
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ Mode Encoder::chooseMode(const QString& content, const QString& encoding)
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
int Encoder::chooseMaskPattern(Ref<BitArray> bits,
|
int Encoder::chooseMaskPattern(Ref<BitArray> bits,
|
||||||
ErrorCorrectionLevel ecLevel,
|
ErrorCorrectionLevel& ecLevel,
|
||||||
Ref<Version> version,
|
Ref<Version> version,
|
||||||
Ref<ByteMatrix> matrix)
|
Ref<ByteMatrix> matrix)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user