epezent / implot

Immediate Mode Plotting
MIT License
4.55k stars 503 forks source link

ImPlot freezing after a while - Raspberry Pi #488

Closed DanielMartensson closed 1 year ago

DanielMartensson commented 1 year ago

I'm using ImPlot on Raspberry Pi. If I just show a constant plot for an hour or two, then my Raspberry Pi is freezing. It's the application of ImPlot that causing this problem.

But I don't know why.

My codes for plotting an ImPlot are here https://github.com/DanielMartensson/GoobySoft/blob/d72ba1af79e76c5804d92a52c92e4ab9d3fbe391/GoobySoft/Windows/Dialogs/MeasurementDialogs/ViewMeasurementDialog/ViewMeasurementDialog.cpp#L122C1-L126C5

https://github.com/DanielMartensson/GoobySoft/blob/d72ba1af79e76c5804d92a52c92e4ab9d3fbe391/GoobySoft/Windows/Dialogs/MeasurementDialogs/ViewMeasurementDialog/ViewMeasurementDialog.cpp#L9-L32

My question is: Have I forgot something?

I'm calling with a create context, but I never call destroy context. Can this be the issue?

ImPlot::CreateContext();
ozlb commented 1 year ago

ImPlot::CreateContext(); must be called only once after ImGui::CreateContext();, so in your project here in GoobySoft/GoobySoft.cpp Do not forget about DestroyContext() functions

DanielMartensson commented 1 year ago

DestroyContext()

@ozlb Thank you. It worked. Did not understand that ImPlot::CreateContext(); should only be called once.