mirror of
https://github.com/DreamSourceLab/DSView.git
synced 2025-01-13 13:32:53 +08:00
fix: Have not free the char buffer formatting from base lib
This commit is contained in:
parent
c50e8f714a
commit
a716beeef8
@ -260,8 +260,7 @@ void DeviceOptions::bind_samplerate(const QString &name, const QString label,
|
||||
|
||||
QString DeviceOptions::print_samplerate(GVariant *const gvar)
|
||||
{
|
||||
char *const s = sr_samplerate_string(
|
||||
g_variant_get_uint64(gvar));
|
||||
char *const s = sr_samplerate_string(g_variant_get_uint64(gvar));
|
||||
const QString qstring(s);
|
||||
g_free(s);
|
||||
return qstring;
|
||||
@ -293,14 +292,20 @@ QString DeviceOptions::print_timebase(GVariant *const gvar)
|
||||
{
|
||||
uint64_t p, q;
|
||||
g_variant_get(gvar, "(tt)", &p, &q);
|
||||
return QString(sr_period_string(p * q));
|
||||
char *pstr = sr_period_string(p * q);
|
||||
QString qstr(pstr);
|
||||
g_free(pstr);
|
||||
return qstr;
|
||||
}
|
||||
|
||||
QString DeviceOptions::print_vdiv(GVariant *const gvar)
|
||||
{
|
||||
uint64_t p, q;
|
||||
g_variant_get(gvar, "(tt)", &p, &q);
|
||||
return QString(sr_voltage_string(p, q));
|
||||
char *pstr = sr_voltage_string(p, q);
|
||||
QString qstr(pstr);
|
||||
g_free(pstr);
|
||||
return qstr;
|
||||
}
|
||||
|
||||
void DeviceOptions::bind_bandwidths(const QString &name, const QString label, int key,
|
||||
|
@ -222,7 +222,11 @@ QString ProbeOptions::print_vdiv(GVariant *const gvar)
|
||||
q = 1;
|
||||
p /= 1000;
|
||||
}
|
||||
return QString(sr_voltage_string(p, q));
|
||||
|
||||
char *pstr = sr_voltage_string(p, q);
|
||||
QString qstr(pstr);
|
||||
g_free(pstr);
|
||||
return qstr;
|
||||
}
|
||||
|
||||
QString ProbeOptions::print_coupling(GVariant *const gvar)
|
||||
|
@ -618,8 +618,9 @@ bool StoreSession::meta_gen(data::Snapshot *snapshot, std::string &str)
|
||||
}
|
||||
|
||||
s = sr_samplerate_string(_session->cur_snap_samplerate());
|
||||
|
||||
sprintf(meta, "samplerate = %s\n", s); str += meta;
|
||||
g_free(s);
|
||||
s = NULL;
|
||||
|
||||
uint64_t tmp_u64;
|
||||
int tmp_u8;
|
||||
|
Loading…
x
Reference in New Issue
Block a user