src/dsecurestring.cpp
raw| 1 | // SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. |
| 2 | // |
| 3 | // SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 | |
| 5 | #include "dsecurestring.h" |
| 6 | #include "dutil.h" |
| 7 | #include <cstring> |
| 8 | |
| 9 | DCORE_BEGIN_NAMESPACE |
| 10 | |
| 11 | DSecureString::DSecureString(const QString &other) noexcept |
| 12 | : QString(other) |
| 13 | { |
| 14 | } |
| 15 | |
| 16 | DSecureString::~DSecureString() |
| 17 | { |
| 18 | DUtil::SecureErase(*this); |
| 19 | } |
| 20 | |
| 21 | DCORE_END_NAMESPACE |