remove delete scene in window destructor, change protection to only allow at least one arg

This commit is contained in:
2025-01-09 17:13:10 +01:00
parent 6070101e28
commit ec765f9e73
2 changed files with 5 additions and 7 deletions

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/27 14:51:49 by TheRed #+# #+# */
/* Updated: 2025/01/08 20:09:47 by ycontre ### ########.fr */
/* Updated: 2025/01/09 16:17:29 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,7 +16,7 @@ int main(int argc, char **argv)
{
Scene scene;
if (argc > 1 && !scene.parseScene(argv[1]))
if (argc <= 1 || !scene.parseScene(argv[1]))
return (1);
Window window(&scene, WIDTH, HEIGHT, "RT_GPU", 0);

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/13 16:16:24 by TheRed #+# #+# */
/* Updated: 2024/12/23 18:39:37 by ycontre ### ########.fr */
/* Updated: 2025/01/09 16:34:48 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -48,8 +48,6 @@ Window::Window(Scene *scene, int width, int height, const char *title, int sleep
Window::~Window(void)
{
delete _scene;
glfwTerminate();
}