Getaudiodata crashing octave for no reason

Hi I am trying to plot data cumming from getaudiodata in real time, in the code below it works for a while , but then Octave suddenly crashes:

clc;
clear all;
close all;

Fs = 44100; 
nBits = 16; 
nChannels = 2; 
ID = -1; % default audio input device 
recObj = audiorecorder(Fs,nBits,nChannels,ID);

record(recObj);

for i = 1:1000
    pause(0.1);
    y = getaudiodata(recObj);
    y = y(end-2047:end);
    plot(y);
end

I found this page where users claim that it was solved by using a patch, this is the page were the topic was discussed:
https://savannah.gnu.org/bugs/?50674

And here is the patch for audiodevinfo.cc which controls all audio stuff for Octave (i guess):
https://hg.savannah.gnu.org/hgweb/octave/rev/471513a016ec

The problem is that I have no idea were to apply this patch. I followed this path on my PC:

Octave-4.4.1\share\octave\4.4.1\etc\tests\libinterp\dldfcn

But the so called audiodevinfo.cc does not contain the getaudiodata function, in fact is not even a proper code from my point if view, this is all its content:

## DO NOT EDIT!  Generated automatically from audiodevinfo.cc by Make.
%!testif HAVE_PORTAUDIO
%! devinfo = audiodevinfo;
%! assert (rows (devinfo.input), 1);
%! assert (rows (devinfo.output), 1);
%!testif HAVE_PORTAUDIO
%! devinfo = audiodevinfo;
%! nout = audiodevinfo (0);
%! nin = audiodevinfo (1);
%! assert (columns (devinfo.output), nout);
%! assert (columns (devinfo.input), nin);
%!testif HAVE_PORTAUDIO
%! devinfo = audiodevinfo;
%! nout = audiodevinfo (0);
%! nin = audiodevinfo (1);
%! for i = 1:nout,
%!   assert (devinfo.output(i).Name, audiodevinfo (0, devinfo.output(i).ID));
%! endfor
%! for i=1:nin,
%!   assert (devinfo.input(i).Name, audiodevinfo (1, devinfo.input(i).ID));
%! endfor
%!testif HAVE_PORTAUDIO
%! devinfo = audiodevinfo;
%! nout = audiodevinfo (0);
%! nin = audiodevinfo (1);
%! for i = 1:nout,
%!   assert (devinfo.output(i).ID, audiodevinfo (0, devinfo.output(i).Name));
%! endfor
%! for i = 1:nin,
%!   assert (devinfo.input(i).ID, audiodevinfo (1, devinfo.input(i).Name));
%! endfor

So i cannot find the audiodevinfo.cc code containing the getaudiodata function to fix. I am really lost, I have always used Matlab and never faced this type of issues, in fact the very same code at the begging works perfectly in Matlab.

Thanks for your time

Octave 4.4.1 is old and no longer supported.

Could you please try if this still occurs with the current version 5.2.0 or the release candidate for Octave 6?