diff options
author | dae hyun, yang <daehyun.yang@gmail.com> | 2016-05-08 01:26:39 +0900 |
---|---|---|
committer | dae hyun, yang <daehyun.yang@gmail.com> | 2016-05-08 01:26:39 +0900 |
commit | 1476345476ad490ec71e88d53ecd4679f4163a38 (patch) | |
tree | b0ec60103d04503f88dde356848ee60c7fd02c25 /gr-fft/lib/fft.cc | |
parent | 75b6e340f82e59d00badeba70263e755075b49c0 (diff) |
runtime: fixed dangling pointer returns in vmcircbuf_prefs.cc and fft.cc
The following error messages occurs In Windows XP/7/8
:Invalid argument
:Invalid argument
:Invalid argument
The reason is
return path.string().c_str(); // return invalid pointer in Windows
XP/7/8
Diffstat (limited to 'gr-fft/lib/fft.cc')
-rw-r--r-- | gr-fft/lib/fft.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gr-fft/lib/fft.cc b/gr-fft/lib/fft.cc index 90417129ed..5af77d97eb 100644 --- a/gr-fft/lib/fft.cc +++ b/gr-fft/lib/fft.cc @@ -83,24 +83,24 @@ namespace gr { return s_planning_mutex; } - static const char * + static std::string wisdom_filename() { static fs::path path; path = fs::path(gr::appdata_path()) / ".gr_fftw_wisdom"; - return path.string().c_str(); + return path.string(); } static void import_wisdom() { - const char *filename = wisdom_filename (); - FILE *fp = fopen (filename, "r"); + const std::string filename = wisdom_filename (); + FILE *fp = fopen (filename.c_str(), "r"); if (fp != 0){ int r = fftwf_import_wisdom_from_file (fp); fclose (fp); if (!r){ - fprintf (stderr, "gr::fft: can't import wisdom from %s\n", filename); + fprintf (stderr, "gr::fft: can't import wisdom from %s\n", filename.c_str()); } } } @@ -124,15 +124,15 @@ namespace gr { static void export_wisdom() { - const char *filename = wisdom_filename (); - FILE *fp = fopen (filename, "w"); + const std::string filename = wisdom_filename (); + FILE *fp = fopen (filename.c_str(), "w"); if (fp != 0){ fftwf_export_wisdom_to_file (fp); fclose (fp); } else { fprintf (stderr, "fft_impl_fftw: "); - perror (filename); + perror (filename.c_str()); } } |